Using `previousHtml` means that if the image attributes changed at all on the server, we can't recognise it anymore. So if you change something on the app after that, the image gets inserted twice.

There's no ideal solution without proper media management implemented, but we could at least be more flexible trying to search for attachments. I'm thinking instead of generating the html we expect an attachment to have and search for that, search for a substring that looks like an attachment and see if we have it.