Another way to do it is by
1. Choosing temporary character replacements for < and >, for example [ and ]
(and you could go with just one substitution character for both < and >)
2. Substituting the chosen characters with their html entitites, for example & #91; and & #93;
(without the whitespace between & and # - editor replaces these entities with their characters)
3. preg_replacing img elements that have domain.com in the src attribute with
< and > replaced by the chars in 1, e.g. [img src="http://www.domain.com/1.gif" /]
Do note that some care has to be taken with the pattern if you want to prevent this
to slip through: http://otherdomain.com/domain.com/1.gif
4. remove all other img elements, for example preg_replace('#<img[^>]+>#', '', $string)
5. replace all occurences of [img ... /] back into <img ... />