How can I make a variant image change on click?

Hi,

I am currently working on a variant image that changes when I click the variants buttons.
Most of the functionality is there but I cant seem to get it to change when I click them.
I only need it to change when I click for the image as everything else works.

If anyone could help or point me in the right direction that would be great as I’m a little stumped by it.

Thanks in advance!