Nice little QoL update, thanks @sam
One quick observation though; the quoted image loses its extension.
If the original image markup is something like this:

the quote it becomes:

It obviously works, there is no problem with it.
However, if ever need to process raw text, do a find & replace, or something similar, omission of the extension may cause a bump, maybe?