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:


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.

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:
→ After: 
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:

And another example of the result:

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)
- From your Shopify admin, go to Online Store > Themes.
- Find your current theme and click Customize.
- In the theme editor, look for Theme settings (usually a gear icon or "Theme settings" in the bottom left sidebar).
- Navigate to Custom CSS (or sometimes "Advanced CSS").
- 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; } - Save your changes.
- 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!
- From your Shopify admin, go to Online Store > Themes.
- Find your current theme, click Actions > Duplicate. This creates a backup.
- Once duplicated, click Actions > Edit code on your original theme.
- In the left sidebar, find the
theme.liquidfile under the Layout folder. - Scroll to the very bottom of the file. Just above the