Shopify Image Resizing Fix: How to Stop Your Homepage Photos from Getting Cropped on Desktop

Hey there, fellow store owners! Let's talk about something that can be a real head-scratcher: getting your beautiful product images to display perfectly across all devices, especially on desktop. We recently saw a fantastic discussion pop up in the Shopify Community forums, titled "Resizing photo for desktop," started by NickyZabetian. It's a classic problem, and the community really came through with some solid advice.

The Frustration: When Your Homepage Image Gets a Haircut

NickyZabetian was running into a common issue with their homepage header image, specifically a "product image with text" section on kinisium.com. On desktop, the image was getting cut off, hiding part of their product. Nobody wants their hero product looking like it's playing peek-a-boo, right? The goal was clear: resize the image to keep it centered and fully visible, without any awkward cropping. Here's what Nicky was seeing:

Screenshot 2026-06-01 at 10.50.04 AM

Screenshot 2026-06-01 at 10.48.51 AM

Why Does This Happen? A Peek Behind the Curtain

Image display issues like this can stem from a few places. As tim_tairli pointed out in the thread, sometimes it's an older theme at play. Themes from version 2.x.x might have animation code that's not quite playing nice with modern browsers, causing images to be "transformed to 130%." This kind of default scaling can easily lead to cropping if the container isn't designed to handle it.

Another community member, Chloe.paker, also observed a "top black bar" that seemed to be contributing to the image getting cut, suggesting that overall layout elements can impact how your images are displayed. It's a good reminder that sometimes the issue isn't just the image itself, but how it interacts with its surrounding elements.

Screenshot 2026-06-02 at 12.33.57 AM

But at its heart, the problem often comes down to how images are instructed to fit within their designated space. By default, many themes use object-fit: cover, which fills the entire content box, cropping the image if necessary to maintain its aspect ratio. What we want for Nicky's scenario is something different: to contain the image within its box, showing the whole thing even if it means some empty space.

The Community's Smart Solutions: CSS to the Rescue!

This is where the power of the Shopify community really shines! Several experts jumped in with practical CSS solutions. The consensus quickly leaned towards using the object-fit: contain property.

Option 1: Addressing Old Theme Animations (if applicable)

If you suspect an older theme might be aggressively scaling your images, tim_tairli offered a great targeted fix. This CSS snippet tells the browser to ignore any default transformation on your images:

picture.media > img {
  transform: none !important;
}

Here's a visual of what that can do:

Before: Screenshot 2026-06-02 at 1.08.44 PM → After: Screenshot 2026-06-02 at 1.08.52 PM

Option 2: The Go-To for Full Image Visibility (Recommended)

For NickyZabetian's specific request to see the entire product without cropping, object-fit: contain is the perfect solution. This CSS property tells the image to scale down to fit within its content box while preserving its aspect ratio. If the aspect ratio of the image doesn't match the container, you'll see empty space (like letterboxing), but your entire product will be visible.

Moeed and devcoders both provided variations of this solution, targeting the specific image elements within the "image with text" section. Combining their insights, here's a robust CSS snippet that should cover most scenarios for this section:

.image-with-text__item img,
.image-with-text__image .media,
.image-with-text__image picture,
.image-with-text__image img {
    object-fit: contain !important;
}

And here's a look at the result with object-fit: contain:

Screenshot 2026-06-02 at 1.09.50 PM

And another example of the result:

image

Step-by-Step Fix: Getting Your Images to Play Nice

Ready to implement this fix on your store? It's pretty straightforward. We'll add this custom CSS to your theme. You have a couple of options:

Method A: Adding to Theme Settings (Recommended for Simplicity)

  1. From your Shopify admin, go to Online Store > Themes.
  2. Find your current theme and click Customize.
  3. In the theme editor, look for Theme settings (usually a gear icon or "Theme settings" in the bottom left sidebar).
  4. Navigate to Custom CSS (or sometimes "Advanced CSS").
  5. Paste the following code into the Custom CSS box:
    .image-with-text__item img,
    .image-with-text__image .media,
    .image-with-text__image picture,
    .image-with-text__image img {
        object-fit: contain !important;
    }
    
  6. Save your changes.
  7. Clear your browser cache and check your homepage on desktop to see the fix!

Method B: Editing the Theme Code (For More Control)

If you prefer to keep your custom CSS directly in your theme files, or if your theme doesn't have a Custom CSS setting, you can add it to your theme.liquid file. Always duplicate your theme before editing code!

  1. From your Shopify admin, go to Online Store > Themes.
  2. Find your current theme, click Actions > Duplicate. This creates a backup.
  3. Once duplicated, click Actions > Edit code on your original theme.
  4. In the left sidebar, find the theme.liquid file under the Layout folder.
  5. Scroll to the very bottom of the file. Just above the tag, paste the following code:
    
    
  6. Save the file.
  7. Clear your browser cache and check your homepage.

If you're still seeing issues, especially if you have an older theme, you might try adding tim_tairli's transform: none !important; code using one of these methods as well, perhaps in combination or as a fallback.

It's awesome to see how quickly the community rallied to help NickyZabetian get their images looking sharp. This kind of collaborative problem-solving is what makes the Shopify ecosystem so great. Remember, responsive design is key for a professional-looking store, and sometimes a little custom CSS is all it takes to make your visuals pop just right. Always test your changes on different screen sizes to ensure everything looks fantastic for all your customers!

Share:

Use cases

Explore use cases

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

Explore use cases