Need to access containers without a handle

Hi,

In the product-images block, I need to target a container that is between two elements that have a CSS handle:
image

Since several CSS selectors were deprecated, I cannot access the div with class relative or the next one, which I would do by using operators like >. Is there a workaround for specific cases where we would need to do this?