There are two separate issues here. The student was wrong and should face consequences. Serious consequences.
But that does not negate the fact that the teacher demonstrated incredibly bad judgment and possibly broke the terms of her contract, because many teacher contracts still cover issues such as this. I don't care if she takes all sorts of nude or semi nude pics for her husband. That's her business. She made it the school's business when she essentially made the pics available to students. To those who say they were "private".....Well, not the way she handled them, they weren't. She had them on an unlocked phone, which she left sitting out in a room she wasn't in. In today's world, that is the same as leaving an envelope of photos sitting on your desk. Had she left the same photos in an envelope on her desk (sealed or unsealed is debatable) and a student accessed them, she would be in hot water. It's horrible judgment.
I can't go into too many details, but there was an incident in which a dance teacher who had been a professional dancer before teaching had some of her photos get passed around. Nothing was x-rated about the pics. She was fully clothed, but think of something along the lines of a pro football cheerleader, only with a little bit more covered. Some of her students got really unpleasant about it, because her standards are that she will not order any costumes which are racy. Some girls got snippy and rude because their attitude was, SHE dressed like THAT and yet she won't let us wear X,Y & Z? The girls aren't dressed like nuns, but nothing risqué is allowed since they are high school girls, ranging from 14 and up. I know the attitude some girls gave because of her fully clothed pics, and if those pics had been of any level of nudity, she would have lost all ability to command respect. Her ability to teach would have been shot.
Again, the teacher's poor decision making skills do not mean the student should escape punishment, both by the school and the law. Make an example of him. But as a teacher at that school, her time is over.