Not sure how you fix it (other than to educate youth and setup technical blocks). I suspect in most cases that police, prosecutors, and other adults "apply common sense", but some prosecutors will do anything to get re-elected (a nude selfie doesn't necessarily ruin a teen's life, but a criminal conviction for it surely will).
Of course you then wonder how much can change in just 2 years, but if you're legally an adult, and you consented to the image, it won't be classed as child porn, but revenge porn laws are a thing.
But the easiest solution is not to consent to being filmed/photographed if you don't want to be...With how google photos uploads automatically the second you take a picture I don't trust smartphones these days...
If we're honest, a lot of the laws were made so far away from the context of the current internet/smartphone culture that they are pretty much useless unless seriously reconsidered (and probably do a lot of immoral harm the way they are written right now).