I see killing yourself being a crime is because society sees you as its slave over whom it can command; slave is worth some money, so why let that money go waste!?
The same is for a kid who takes and sends pictures of him/herself. Child pornography is a crime to prevent bad people from taking advantage of kids and documenting it for whatever sick reasons they have. But a kid can't be both the perpetrator and victim of that crime.
In normal situations when you run into such a logical fallacy you have to discard it. But this is the law we're talking about and there's no such need. So yes kids can get prosecuted even though no crime has taken place. It's a symptom of people doing their jobs exactly by the book with no thought whatsoever for if it's the actual, correct thing to do. It's too bad.
I mean, "they didn't think of it" argument does not work because the law is pretty old and the failure in question happens all the time and gets in the press.
So either they wanted to punish teenagers OR they were so afraid of missing one or two real child pornographers that millions of false positives and hundreds of cases didn't counterweight them to add respective exceptions. Anyway, we're dealing with people who are very, very misguided to the point of being danger for humanity.
Ultimately it's what happens when the system is highly skewed towards zero accountability. The cost to the individuals pursuing these cases is small and there's good upside risk: putting away child pornographers is great for your career. And the downside risk is HUGE! Failing to put someone away for it is going to make you look really bad. So reasonable people making reasonable decisions need never happen.