Add/remove element attribute based on Ecommerce product category

The store I am working on has two product categories; prints and framed prints:

I apply a picture frame with CSS via id attribute to framed prints. It’s easy to do on the above -linked page since I’m using two collection repeaters. But take for example a product page which can have a product of either category:

Is it possible to add/remove an element’s id attribute based on the enclosing product’s category? E.g. if on print product’s page I want to remove id attributes that give the images their frame. I can do this with JS by inspecting the URL, but this doesn’t seem scaleable or ‘safe’.

What’s the ‘webflow’ way to do this (conditionally apply CSS)?

Figured out a solution: I just duplicated the section that has the image and removed the CSS ids that give it the frame. I conditionally show each section on category name and it works fine.