you need to use 2 separate preg_replace functions, one to remove images, and another to remove anchors.
due to the complexity of what you are trying to accomplish, it may be better to create a function to perform each string manipulation rather than trying to add them all inline.