Product-template W3C validation error due to <style> in div

I’m trying to validate my product pages (Debut theme) via W3C validation.

One of my errors is due to the below CSS section that is injected directly into a

:


      

      
        ...
      

    

Unfortunately, the CSS seems to be dynamically generated, hence I can’t perform a simple liquid replace - moving the CSS to my custom stylesheet.

Any suggestions on how I can “move” this CSS to a proper location and thus avoid the W3C validation error? It must be possible to get a fully W3C validated site.

Thanks!

Solved this by removing below from media.liquid:

{% include 'image-style', height: height, wrapper_id: media_wrapper_id, img_id: media_id, image: media.preview_image %}