Shopify Product Gallery Glitch: Why Your Alternate Images Aren't Showing (and How to Fix It!)
Hey everyone! As a Shopify expert, I spend a lot of time diving into the community forums, and it’s always fascinating to see the real-world challenges store owners face. Recently, a thread popped up that really caught my eye, and it’s a problem I know many of you have likely grappled with: product images not displaying correctly.
Our friend PNT, from Pasadena Neurotech, reached out with a classic head-scratcher. They were using the Spotlight 15.4.1 theme and had configured their product pages with the “thumbnail carousel” option. Sounds great, right? The goal was to let customers easily click through multiple product photos without having to open a full-screen gallery. But there was a snag:
- Clicking on thumbnails would show the same image, no matter which thumbnail was selected.
- On mobile, or when the desktop browser was narrowed, the navigation arrows (< 1/3 >) would appear, but clicking them did absolutely nothing.
- Even on the homepage, the featured collection element wouldn't allow users to click through all alternative images, only showing a hover effect.
PNT shared some helpful screenshots, and you can see the initial problem here:
And then, after clicking, the main image still wouldn't update:
And the non-functional mobile arrows:
The Initial Head-Scratchers: Is it JavaScript or CSS?
When PNT first posted, some community members, like alikhanharis515, quickly pointed towards a JavaScript problem. It seemed logical: the thumbnails were there, the counters showed the right number of images, and interactive elements changed color on click. This suggested the problem wasn't with image uploads, but with the gallery's functionality. Jarid even offered a potential CSS fix involving the is-active class, which often controls image visibility.
However, as the discussion evolved, the community's collective expertise dug deeper.
The "Aha!" Moment: Missing Markup, Not Broken Clicks
This is where smallfixeslab and Bristan_FARRE really shined. They performed some crucial diagnostic steps, checking the raw HTML before any JavaScript even ran. Their findings were eye-opening:
- Even though PNT's products had multiple thumbnails (e.g., Barcoder had 4, PicoDAQ had 3), the rendered HTML only contained one gallery slide.
- The other media IDs simply weren't present in the main gallery list.
- Crucially, no image was marked
is-activeon load, which meant the main image area often started at zero height.
As Bristan_FARRE put it perfectly, "The missing slides are never sent by the theme’s Liquid. No CSS rule and no JavaScript fix can bring them back, because there is nothing on the page to show." Icey.Lane echoed this, emphasizing, "JavaScript or CSS cannot reveal markup that was never emitted."
This was a critical pivot! It wasn't about broken JavaScript or CSS hiding elements; it was about the theme's core Liquid code failing to output all the image elements in the first place.
The Root Cause: An Outdated, Custom Theme
The definitive diagnosis came from Ploqo, who identified the core issue: PNT's live theme was a custom copy of Spotlight. This meant it wasn't receiving automatic Shopify theme updates. Over time, the custom theme's code, specifically the Liquid snippets responsible for the product gallery, had become outdated. A newer version of Spotlight (like version 16, which Ploqo referenced) correctly renders a slide for every image.
Ploqo even showed how the outdated theme lacked an "Update" button because it wasn't directly from the Theme Store:
The problem wasn't with PNT's settings or even a simple bug; it was a fundamental discrepancy in the theme's underlying code.
The Fix: Updating Your Theme's Gallery Code
So, what's the solution when your custom theme is falling behind? Ploqo offered two clear paths, and PNT confirmed that this indeed fixed their problem!
Method 1: The Clean Slate (Recommended for simpler customizations)
This method involves starting fresh with an updated theme and then reapplying your settings. It's often the safest bet if your customizations aren't too extensive.
- Add a New Spotlight Theme: Go to your Shopify admin, navigate to Online Store > Themes. Click "Visit Theme Store," search for "Spotlight," and click "Add." This will add the latest version of Spotlight as a draft theme to your store.
- Preview and Test: Before changing anything, preview a product page on this new draft theme. Verify that the image gallery now works as expected, displaying all alternate photos when thumbnails or arrows are clicked.
- Migrate Settings: If the gallery works, you'll need to manually transfer your theme settings (colors, fonts, section layouts, app integrations, etc.) from your old custom theme to this new draft.
- Publish: Once you've moved all your settings and are happy with the preview, publish the new theme.
Method 2: Updating Specific Snippets (For preserving complex customizations)
If you have a lot of custom code or modifications in your theme, you might want to try updating just the problematic snippets. This requires a bit more comfort with theme code.
- Add a Fresh Spotlight Draft: Follow step 1 from Method 1 to get a clean, current version of the Spotlight theme as a draft. You won't publish this, it's just for reference.
- Access Theme Code: In your Shopify admin, go to Online Store > Themes. For your current custom theme, click "Actions" > "Edit code." Do the same for the new Spotlight draft theme.
- Locate and Copy Snippets: In the new Spotlight draft theme's code editor, navigate to the
snippetsfolder. Find the filessnippets/product-media-gallery.liquidandsnippets/product-thumbnail.liquid. Copy the entire content of these files. - Paste and Replace: Go to your current custom theme's code editor, find the corresponding files in its
snippetsfolder, and replace their content with the code you copied from the fresh Spotlight draft. - Test Thoroughly: Always test these changes on a duplicate of your live theme or a development store first. Ensure everything works as expected before pushing to your live store.
What About the Homepage Featured Collection?
PNT also asked about showing all images in a carousel on the homepage's featured collection. As alikhanharis515 and Ploqo pointed out, Shopify's standard featured collection sections typically only show the first image and a second image on hover. To add a full image carousel with clickable arrows directly on the homepage product cards, you'd need custom code on the card snippet or a dedicated app. This is generally a separate customization from the product page gallery fix.
The lesson here is a big one for any store owner: while custom themes and unique designs are fantastic, they come with a responsibility to keep them updated. Shopify's themes receive regular updates for performance, security, and new features. If you're running a heavily customized theme, you or your developer need a strategy to incorporate these updates, especially for core functionalities like product galleries. Otherwise, you might find yourself with unexpected glitches that impact your customer's shopping experience and ultimately, your sales!




