How do I remove the Li Id Slide-Template of my Stacked Photos?

Hi,

I have a series of photos and I edited the liquid file and JS to show the images on my product page based on the variant selector.

I realised that one of my photo constantly appear on my other variant selector despite not tagged to the other variant by alt text. I inspected the element and realised that the photo instead of taking the alt text as the Li ID, its existing Li Id is “Slide-template–21855231770933__main-37099481202997”

Can anyone advised on how I can change all my photos to be tagged according to my alt text. I am using Dawn Theme Ver 11.

The neutral gift sets continues to appear after changing the variant.

I realised that this code was the code that affected the Id of the first variant image and it does not seem to change if a new variant is selected.

May I know if anyone could advise?