@evanzhang,
There are a few issues:
1. This might just be a copy and paste error but you should check and make sure that your quotations are not “pretty” quotes. When I copied and pasted your image module into a template on my portal it threw an error because the quotations were not straight quotes.
2. spacing in your code. This may or may not be part of your issue but where you define your label there is space before and after the = sign.
3. Your styles are being applied directly to the img tag that is output by the module code, however class is not actually a Hubspot Module parameter. The correct parameter is extra_classes=“”.
4. Hubspot auto wraps modules in a span tag. here is the current markup coming from your module:
<span id="hs_cos_wrapper_banner_image" class="hs_cos_wrapper hs_cos_wrapper_widget hs_cos_wrapper_type_linked_image" style="" data-hs-cos-general-type="widget" data-hs-cos-type="linked_image">
<img src="https://gallery.mailchimp.com/d5501bca182eab78bf615fa74/images/e1f721c1-8a95-4210-b94a-1f9ab7ee79dc.png" class="hs-image-widget " style="border-width:0px;border:0px;max-width:1134px; padding-bottom: 0; display: inline !important; vertical-align: bottom;" alt="" title="">
</span>
If you chance class to extra_classes then you class will be applied to this span tag. If this span tag is what is causing your issues you can remove it by using no_wrapper=True in your module code, however extra_classes will not work because with the span tag gone there is nothing to apply the class to. Unfortunately there is not way to apply classes to the actual elements that are output my module codes, just to the optional wrapper span tag for the modules. It’s a little silly in my opinion.
I’m removing your url and styles to make the code shorter -
with class applied to span wrapper:
{% linked_image "banner_image" label="Banner Image", src="image.url", style="element: styles;", extra_classes="mcnImage" %}
without class or span wrapper:
{% linked_image "banner_image" label="Banner Image", src="image.url", style="element: styles;", no_wrapper=True %}
I changed all of your quotation marks, formatted your attributes, and added missing commas so you may want to copy one of the above.
If niether of these work then I would suggest using export_to_template_context=True. It’s more complicated but allows for ultimate control over your code.