I'm obviously not advocating or defending any particular behavior.
Legally speaking, why is what age they are today relevant rather than the age they are depicted as in the picture? Like, imagine we have a picture 20 years from now of someone at age 37. It's legally fine until it's revealed it was generated in 2023 when the person in question was 17? If the exact same picture was generated a year later it's fine again?
That is a completely legitimate concern. It's important to note that even if prisons are publicly run, there's still a bunch of private actors in the prison system in the form of the people who work in it. Prison worker unions and police unions lobby for more laws already to protect their jobs. Private prisons might make that aspect worse, but it's not like it's perfect now.