# Problem setting default image for custom module in a theme

**URL:** <https://community.hubspot.com/t/problem-setting-default-image-for-custom-module-in-a-theme/50696>\
**Category:** CMS Development\
**Created:** [February 1, 2022, 5:11pm UTC](https://community.hubspot.com/t/problem-setting-default-image-for-custom-module-in-a-theme/50696 "2022-02-01T17:11:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MrCapp](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mrcapp/32/82209_2.png) [@MrCapp](https://community.hubspot.com/u/MrCapp)\
**Post date:** [February 1, 2022, 5:11pm UTC](https://community.hubspot.com/t/problem-setting-default-image-for-custom-module-in-a-theme/50696/1 "2022-02-01T17:11:26Z")

</div>

Hello.

I’m moving a bunch of our existing custom modules into a theme. I would like to change the default image that loads with the module - in this case an image used as a background in a billboard header module.  
The image appears in the module but the link to the image in the preview appears broken - see screenshot. it also appears when I preview the page.

 ![MrCapp_0-1643734943263.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/e/1/e16f86ab7f52a7e3b26a63006f7885d19a612b6c.png)

Here’s the code from the fields.json - any thoughts on what would cause the preview image appear to be broken?

```lia-code-sample
{
 "id" : "0f2fadbd-06a5-a855-8253-2f58bd42b774",
 "name" : "large_image",
 "label" : "Large Image",
 "help_text" : "Add your desktop image",
 "required" : false,
 "locked" : false,
 "responsive" : false,
 "resizable" : true,
 "show_loading" : false,
 "type" : "image",
 "default" : {
 "src" : "{{ get_asset_url('../images/module-images/module-banner-01.jpg') }}",
 "alt" : " ",
 "width" : "2000",
 "height" : "1000"
 }

```

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [February 2, 2022, 8:34am UTC](https://community.hubspot.com/t/problem-setting-default-image-for-custom-module-in-a-theme/50696/2 "2022-02-02T08:34:26Z")

</div>

Hi @MrCapp ,  
Remove curly braces and commas from image code, use this code:  
“default” : {  
“src” : get\_asset\_url(‘../images/module-images/module-banner-01.jpg’),  
“alt” : " ",  
“width” : “2000”,  
“height” : “1000”  
}

Hope this helps!

If we were able to answer your query, kindly help the community by marking it as a solution.  
Thanks and Regards.

---

<div class="post-metadata">

**Author:** ![MrCapp](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mrcapp/32/82209_2.png) [@MrCapp](https://community.hubspot.com/u/MrCapp)\
**Post date:** [February 2, 2022, 4:26pm UTC](https://community.hubspot.com/t/problem-setting-default-image-for-custom-module-in-a-theme/50696/3 "2022-02-02T16:26:07Z")

</div>

Thanks for the suggestion but that gives me an error:

`[ERROR] Unrecognized token 'get_asset_url': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false') (line:97, column:27)`

Any other suggestions?

The only thing that has worked is using an absolute path to an image in the main image directory. But I’m trying to keep all the theme images within the theme itself.

---

<div class="post-metadata">

**Author:** ![MrCapp](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mrcapp/32/82209_2.png) [@MrCapp](https://community.hubspot.com/u/MrCapp)\
**Post date:** [February 2, 2022, 4:42pm UTC](https://community.hubspot.com/t/problem-setting-default-image-for-custom-module-in-a-theme/50696/4 "2022-02-02T16:42:46Z")

</div>

Fixed it by just using plain HTML:  
“default” : {  
“src” : “../../images/module-images/module-banner-01.jpg”,  
“alt” : " ",  
“width” : “2000”,  
“height” : “1000”  
}
