We can wrap text in ==text== to highlight it.
I’m trying to make a CSS snippet that can highlight an image ==![|50%](https://raw.githubusercontent.com/darlal/obsidian-switcher-plus/master/demo/headings-command.png)==
It seems like you’re working in live-preview, and with the code you’ve listed there the code mirror engine simply removes the highlighting around the image, so it doesn’t look like you’re able to highlight an image at all using this syntax. (That is beside something with a .cm-line having an <img> within, and I don’t think that’s unique enough for reliable CSS selection)
In reading view, the highlight elements are kept, as you then get a <mark><img ... ></mark> layout, so there you should be able to do some CSS styling to it.
To get something similar in live-preview, I’m not sure what you need to.