Avone theme on the product page, hide all variant images, except for images not assigned to variants

Hi, I would like to hide all the image thumbnails on the product page that are linked to variants, except when the variant option is clicked on, then it should display in the main product image. And then also I want all other images that are uploaded to the product but not assigned to a variant to display. In other words, hide all variant linked images only, but show them when variant is clicked on.

I tried putting

.product-single__thumbnails { display: none;}

in theme.css.liquid

But this hides all images including the ones not linked to variants.

I saw another post saying to edit the product.liquid with:

  {% for image in product.images %}
    {% unless image.attached_to_variant? %}
      <li class="grid__item ...
          ...
      </li>
     {% endunless %}
  {% endfor %}

But I cannot find this text in my specific theme, so need some help to basically do the same as above.

Here is product.liquid if that helps:

{%- if settings.breadcrumb_pr -%}{%- include ‘breadcrumb’ -%}{%- else -%}

{%- endif -%}
{%- if settings.product_latyout == “style6” -%}

{% section 'product-template' %}
{%- if settings.store_ft1 != blank or settings.store_ft2 != blank or settings.store_ft3 != blank -%}
{%- if settings.store_ft1 != blank -%}

{{settings.store_ft1}}

{%- endif -%} {%- if settings.store_ft2 != blank -%}

{{settings.store_ft2}}

{%- endif -%} {%- if settings.store_ft3 != blank -%}

{{settings.store_ft3}}

{%- endif -%}
{%- endif -%} {% section 'related-products' %} {% section 'product-recommendations' %} {% section 'recently-viewed' %}
{%- else -%} {% section 'product-template' %} {% section 'related-products' %} {% section 'product-recommendations' %} {% section 'recently-viewed' %} {%- endif -%} {%- include 'product-popup' -%}

{%- assign current_variant = product.selected_or_first_available_variant -%}