Is there a way to get every image on a page with the class of '.photo' and apply the class of '.vertical' to the article it's in if that photo's height is more than 450px tall? The reason I'm doing this is because I want tall photos to be less wide, therefore adding the class .vertical to style the article it's in to make that article 250px instead of the normal width of 500px...
Basically if a photo's 500px version is displayed on a page and the 500px photo has a height of more than 450px, it should resize the entire article it's in by adding the class .vertical to that article.
It sounds confusing but it's not once you understand it. I'm new to this so codes are appreciated, I have no clue what to do.