如何测试添加的图像是否适用于WooCommerce产品?

In my Woocommerce site, I'm creating a lot of downloadable products. The download is the full-size image. I have to set a parameter to the download URL. The code to set the parameter is functioning properly.

What remains is that this code only has to run if the image (media) is a product image. I don't want to set the parameter when it is an image added to a blog post or a page.

I've searched for something like if_is_product_image() or something like that but did not succeed. What can I do?

EDIT: little flowchart to (hopefully) make it more clear

enter image description here