having no clue of what your structure or data looks like, here's something that might help.
before deleting, select to make sure that these are posts that you want to delete
SELECT * FROM posts WHERE post_content NOT LIKE '%<img src=%'
then after seeing the results and you're happy to delete them, use
DELETE FROM posts WHERE post_content NOT LIKE '%<img src=%'