Background image style tag

I am using background images, when I set a static background image the HTML follows this pattern:

div class=“x-bg-layer-lower-image” data-spai-exclude=“none” data-spai-bg-on=“1” style="background-image: url(“https://cdn.shortpixel.ai/x96/q_glossy+sc_0x211:800x110:1600x220+to_auto+ret_img/wp-content/uploads/2025/11/snowymountains-2.avif”) !important;" data-spai-lazy-loaded=“true” data-spai-bg-prepared=“1” data-spai-bg-lazyloaded=“1”>

The key bit being: style="background-image

If I pull the image URL from a looper and set it dynamically, I get this:

a class=“x-div e199050-e58 m49l6-2g m49l6-2k m49l6-2l m49l6-2m m49l6-2o m49l6-2q m49l6-2r m49l6-2s” style="–tco-dc49l6-a:url(https://ags-s3-amazon.s3.eu-west-2.amazonaws.com/wp-content/uploads/2024/03/Class-7_Giants-Castle-Drakensberg.jpg);" href=“https://agsnew.com/news/ags-photographic-competition-2024/”>


The change being to this style="–tco-dc49l6-

This breaks my ShortPixel processing and is incorrect anyway, it should still be a background image.

Any ideas?

Thanks, Bill.