diff --git a/snippets/product-media-gallery.liquid b/snippets/product-media-gallery.liquid
index 8d38a87..ce0e57b 100644
--- a/snippets/product-media-gallery.liquid
+++ b/snippets/product-media-gallery.liquid
@@ -182,39 +182,6 @@
(min-width: 750px) calc((100vw - 15rem) / 8),
calc((100vw - 8rem) / 3)
{%- endcapture -%}
- {%- if featured_media != null -%}
- {%- liquid
- capture media_index
- if featured_media.media_type == 'model'
- increment model_index
- elsif featured_media.media_type == 'video' or featured_media.media_type == 'external_video'
- increment video_index
- elsif featured_media.media_type == 'image'
- increment image_index
- endif
- endcapture
- assign media_index = media_index | plus: 1
- -%}
-
- {%- capture thumbnail_id -%}
- Thumbnail-{{ section.id }}-0{{ id_append }}
- {%- endcapture -%}
-
-
- {%- endif -%}
{%- for media in product.media -%}
{%- unless media.id == product.selected_or_first_available_variant.featured_media.id -%}
{%- liquid
@@ -269,6 +236,39 @@
{%- endunless -%}
{%- endfor -%}
+ {%- if featured_media != null -%}
+ {%- liquid
+ capture media_index
+ if featured_media.media_type == 'model'
+ increment model_index
+ elsif featured_media.media_type == 'video' or featured_media.media_type == 'external_video'
+ increment video_index
+ elsif featured_media.media_type == 'image'
+ increment image_index
+ endif
+ endcapture
+ assign media_index = media_index | plus: 1
+ -%}
+
+ {%- capture thumbnail_id -%}
+ Thumbnail-{{ section.id }}-0{{ id_append }}
+ {%- endcapture -%}
+
+
+ {%- endif -%}