how to show only selected variant images dawn (and correct color pictures in the thumbnail carousel)

Hi!

Thank you so much for taking your time and helping me. I dont know anything about code but i learn fast. So this is the current code i find in my product-media-gallery.liquid, from 93 to 96:

93: <li
94: id=“Slide-{{ section.id }}-{{ media.id }}{{ id_append }}”
95: class=“product__media-item grid__item slider__slide{% if single_media_visible %} product__media-item–single{% endif %}{% if product.selected_or_first_available_variant.featured_media == null and forloop.index == 1 %} is-active{% endif %}{% if media.media_type != ‘image’ %} product__media-item–full{% endif %}{% if section.settings.hide_variants and variant_images contains media.src %} product__media-item–variant{% endif %}{% if settings.animations_reveal_on_scroll %} scroll-trigger animate–fade-in{% endif %}”

96: data-media-id=“{{ section.id }}-{{ media.id }}”

Is the 94 i should replace with: {% for variant in product.variants %}
{% if variant.id == selected_variant_id %}
{{ variant.image.alt }}
{% endif %}
{% endfor %} ??

Thanks in advance!