Despite the prior news story about a guy getting off for upskirt photos, this law seems like a solution looking for a problem. Has upskirt photography been such a large problem in Massachusetts that a law was required?
In short, yes, it's been a problem in general for a while, enough so that camera phones are have been required for about 5 years by federal law (the Camera Phone Predator Alert Act) to make a noise when they take a picture to make it harder to sneak an up skirt photo on the subway.
Do you technically run afoul of the law anytime you take a photo where a woman in a skirt is elevated from your current location, such as a place with an elevated walkway? Do you risk arrest for taking a picture in a location with an escalator or glass-walled elevator like many shopping malls? even if you are close to neither one?
Assuming you mean somebody accidentally captured an up skirt photo in the frame, then no. Not only would there be no criminal intent in that case, but according to TFA "The legislation says anyone who tries to photograph another person's sexual or intimate parts without that person's consent..." so there was no trying involved in that case (of course, the article could just be worded poorly, but there would still be no criminal intent).