When pasting a string where the tag is given as encoded entity, it is not being stripped.
Copy an encoded html string into the ckeditor field.
Decode the html string before replacing the img tags.
Active
2.0
Code
Added a patch. Also removed that annoying alert :p