How can I use interaction to show and hide an image

Hi guys,
I create a button and want to use it to show and hide an image.
This is how I do it but it does not work.
I use interaction to add and remove a class.
After that, I use conditional trigger to check if it has a class.
But it does not work.
Please help me.

can you write more about what you are trying to do and what have you tried