How to adjust variant picker code for automatic image display?

ON my product page I have two types of variants " circular strips and rectangular strips" I push the circular variant and it shows a round product picture like it should. But when I push the rectangular variant it doesn’t show any picture until I select a rectangular measurement button. How do I make it work when I just want to push the circular button and it shows and then just push the rectangular button and make it show the rectangular picture without pushing a rectangular measurement button. Is there a code to add or adjust to just use those to variant buttons?

Help Needed

Hi,

You have to assign an image to the variants.

A product can have multiple images for multiple variants.
When selecting a variant it will show the image assigned to that variant, if no image has been assigned to the variant it will show the default image for the product.

You can assign an image to a variant by going to the product and press “edit” next to the variant.

Under the section “options” you’ll be able to select an image for that variant.