# Img\_url creates a 404 URL, although the image exists

**URL:** <https://forum.ghost.org/t/img-url-creates-a-404-url-although-the-image-exists/37318>\
**Category:** Themes\
**Created:** [March 24, 2023, 8:20pm UTC](https://forum.ghost.org/t/img-url-creates-a-404-url-although-the-image-exists/37318 "2023-03-24T20:20:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Richard\_Pickett](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/richard_pickett/32/20917_2.png) [@Richard\_Pickett](https://forum.ghost.org/u/Richard_Pickett)\
**Post date:** [March 24, 2023, 8:20pm UTC](https://forum.ghost.org/t/img-url-creates-a-404-url-although-the-image-exists/37318/1 "2023-03-24T20:20:23Z")

</div>

First, yes, I searched - but don’t see a post covering this problem.

I’ve created a custom them and have a headshot under /assets/images/headshot.jpg.

I can access that image from the web via /assets/images/headshot.jpg (it loads no problem)

I’d like to have the image size auto-resize to “medium” and think I’m using the image\_url correctly, but it always generates a URL that gives a 404:

> \<img  
> class=“border-radius”  
> style=“width:80%;margin-left:auto;margin-right:auto;”  
> src=“{{img\_url ‘/assets/images/headshot.jpg’ size=“m”}}”  
> alt=“Richard Pickett Profile Photo”  
> /\>

The URL it generates is:

/assets/images/headshot.jpgcontent/images/size/w600

I can’t even figure out what the “real” url should be that would include the width desired so I can hard-code it.

What’s the right way to specify this src?

Thanks!

---

<div class="post-metadata">

**Author:** ![satonotdead](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/satonotdead/32/33666_2.png) [@satonotdead](https://forum.ghost.org/u/satonotdead)\
**Post date:** [March 25, 2023, 2:16pm UTC](https://forum.ghost.org/t/img-url-creates-a-404-url-although-the-image-exists/37318/2 "2023-03-25T14:16:47Z")

</div>

Are you self-hosting?

It seems that you need to look into the proxy, CDN or the system handling the images.

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [March 25, 2023, 2:25pm UTC](https://forum.ghost.org/t/img-url-creates-a-404-url-although-the-image-exists/37318/3 "2023-03-25T14:25:53Z")

</div>

Ghost doesn’t resize images loaded as part of the theme.

Img\_url is intended for loading an image uploaded as part of a post or page and stored in the content directory.

You’re meant to use the assets helper to load theme assets, but I don’t believe it’ll do resizing you you.

You could load several sizes for the images built into the theme, or you could load those into Ghost through the post editor.
