Product Images Not Changing? How to Fix Your Shopify Theme's Gallery Glitch

Hey there, fellow store owners! Let's talk about something super important for every e-commerce business: your product images. We all know that high-quality, easily viewable product photos are absolutely crucial for making sales. If customers can't properly see what they're buying, they're likely to bounce, right?

Recently, I was following a really insightful discussion in the Shopify community that highlighted a common, yet tricky, problem: product images not displaying or switching correctly on product pages. A store owner, PNT, was pulling their hair out because their alternate product photos weren't showing up when clicked on their product pages, whether on desktop or mobile. Even the little navigation arrows on mobile weren't working!

The Mystery of the Stuck Product Images

PNT had set up their Shopify store using the Spotlight 15.4.1 theme and opted for the 'thumbnail carousel' layout for product information. Sounds great in theory, right? You want users to see multiple photos without having to dive into a full-screen gallery. But what was happening was frustrating:

  • Clicking on different thumbnails would always show the same main image.
  • The displayed image didn't match the selected thumbnail.
  • On mobile, or when the desktop browser was narrowed, the navigation arrows (< 1/3 >) were there and clickable (they even changed color!), but nothing happened when you tapped them.

Take a look at what PNT was seeing:

Product page showing a single main image with thumbnails below

Product page showing selected thumbnail not matching the main image

Mobile product page with navigation arrows not functioning

Community Detectives: Pinpointing the Real Culprit

Initially, some community members, like Jarid, suspected a CSS or JavaScript issue. It's a common thought, right? If buttons are clickable but nothing happens, it often points to a JS problem. Jarid even found some CSS that hides images not marked as .is-active, suggesting a fix to ensure the first image loads with that class:

class="product__media-item{% if forloop.index == 1 %} is-active{% endif %}"

However, the real breakthrough came from a few sharp-eyed analysts like smallfixeslab, Bristan_FARRE, and alikhanharis515. They dug deeper, going beyond what was visible in the browser and inspecting the raw HTML output. Their findings were critical: the problem wasn't that the JavaScript wasn't working, or that CSS was hiding things. The core issue was that the theme's Liquid code simply wasn't rendering all the product image 'slides' in the first place!

As Bristan_FARRE put it, "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." The theme was only outputting one main media item, even if it showed multiple thumbnails. This meant the gallery output was incomplete from the get-go.

The final piece of the puzzle came from Ploqo, who identified the root cause: PNT's live theme was a custom copy of Spotlight. This meant it hadn't received official Shopify theme updates, leading to outdated code that couldn't handle the product gallery correctly.

Barcoder page on load: four thumbnails, empty main image area

Thumbnail 1 is selected but the photo on show is thumbnail 2

Ploqo demonstrated that a current version of Spotlight (like version 16) correctly renders a slide for every image:

Spotlight 16, same settings: thumbnail 3 selected and the main photo is thumbnail 3

Your Fix: How to Get Those Images Working!

If you're facing a similar issue, it's highly likely your theme is outdated, especially if it's a custom version or hasn't been updated in a while. Here are the two main ways to fix it, drawing directly from Ploqo's excellent advice:

Option 1: Install a Fresh Version of Your Theme (Recommended for most)

This is often the simplest and most robust solution, especially if you haven't made extensive code customizations to your current theme. It ensures you get all the latest features, bug fixes, and performance improvements.

  1. Go to the Shopify Theme Store: In your Shopify admin, navigate to Online Store > Themes. Look for the "Visit Theme Store" button. You can also directly visit themes.shopify.com.

  2. Find Your Theme: Search for your current theme (e.g., "Spotlight"). Click on it.

  3. Add as a Draft: Click "Add theme" or "Add to library." This will add a fresh, updated version of the theme to your store as a draft. Do NOT publish it yet!

  4. Preview and Test: Go back to Online Store > Themes. Find your newly added draft theme. Click "Actions" and then "Preview." Navigate to a product page (like the one that was having issues) and test the image gallery. Do the thumbnails work now? Do the mobile arrows function?

  5. Migrate Settings: If the gallery works in the new draft, you'll need to re-apply your theme settings and customizations from your old theme to the new one. This includes colors, fonts, section layouts, app integrations, etc. Take your time with this step.

  6. Publish: Once you've migrated all your settings and are happy with how everything looks and functions, you can publish the new theme.

Remember, if you're just starting your e-commerce journey or looking to switch platforms, starting a Shopify store with an up-to-date theme is a fantastic way to ensure a smooth experience for you and your customers!

Option 2: Manually Update Theme Snippets (For Developers/Custom Themes)

If you have a heavily customized theme and don't want to re-apply all your customizations, you can try updating just the problematic Liquid snippets. This is a bit more technical and should be done carefully.

  1. Add a Fresh Theme (Draft): Follow steps 1-3 from Option 1 to get a current version of your theme as a draft in your theme library.

  2. Access Code Editor: For both your current live theme (or a backup of it) and the new draft theme, go to Online Store > Themes > Actions > Edit code.

  3. Locate Snippets: In the new draft theme's code editor, find the following files under the "Snippets" directory:

    • snippets/product-media-gallery.liquid
    • snippets/product-thumbnail.liquid
  4. Copy Code: Copy the entire content of these two files from the new draft theme.

  5. Paste into Your Custom Theme: Switch to your custom theme's code editor and replace the content of its corresponding snippets/product-media-gallery.liquid and snippets/product-thumbnail.liquid files with the code you copied.

  6. Test on a Draft: It's crucial to test these changes on a duplicate of your live theme or another draft theme before pushing them to your live store. Ensure the gallery now functions as expected.

The gallery snippet in the theme code editor

What About the Homepage Featured Collection?

PNT also asked about showing all product images on the homepage's featured collection element. The community clarified that Shopify themes typically only display the first image and a second image on hover for product cards in collections. If you want a full carousel or clickable arrows to cycle through all images directly on the homepage, that's going to require custom code on the card snippet or a dedicated app. It's a separate enhancement from fixing the core product page gallery issue.

Ultimately, PNT confirmed that Ploqo's fix worked, which is fantastic! This whole discussion is a great reminder that keeping your theme updated is vital, and sometimes what looks like a simple JavaScript or CSS problem can actually be a deeper issue with how your theme's Liquid code is rendering content. Always test thoroughly, and don't be afraid to leverage the amazing insights from the Shopify community!

Share:

Use cases

Explore use cases

Agencies, store owners, enterprise — find the migration path that fits.

Explore use cases