I need to check if an image media field is housed in a paragraph to remove the alt attribute of that attribute. The same image field could be referenced anywhere. I could remove the alt field it within preprocess_image by checking if the value is set to a particular value.
However I need a more robust method by checking if the field is housed inside a paragraph/belongs to a paragraph. Maybe we can pass a variable from the parent template to the image template variables?