It works if you escape the the greater than signs (except for the ones that are used to close the img elements).
In my editor (atom), I can do this with a find/replace in regex mode as
find: [^\/](>)
replace with: >
... resulting in... (view this raw to see the text)