Stranger danger is a bad thing to teach kids. It's not very valid. They are actually in a LOT more danger from people they actually know than some random stranger off the street or out in the big bad world. Not a lot of people use this anymore.
Now, if you're asking about kids on the internet and using the chat options for their games and electronics then you simply need to turn off the chat options. Letting them know they are talking to people pretending to be things they aren't isn't a bad thing to teach anyone.
Our kids have been on FB since they were around 5 or 6. They love playing games and I managed their account. They didn't even know their passwords. They were only friends with people that I allowed them to accept friend requests from and each of those people were people I actually know, face to face know, not people I've friended for the sake of playing games. They could only be friends with actual people we know or are related to.
They were very happy with that and as they've entered the age where they can actually have their own accounts I only supervise occasionally they are much better at it than some kids. They all know that if I see a word we don't allow or photos that I don't allow or anything that isn't above board they are off their accounts.
One thing that a speaker shared at General Conference one time was important and we started it the next day, it was this: Everyone in your family should have their computers/electronics in the main part of the house. Where the screens are facing where anyone that walks by can see what is being looked at, with spiritual images on the walls that will inspire that person to take the higher road when they're being tempted to do things and go on the net to places they shouldn't go. To remind them of who they are and that they should choose to not do that. So all our computers are in our living room/dining room. Even when the kids are on the computers they are in the same room as the adults and we can glance over at any second and see exactly what they're doing. We also have full access to their memory/history. My husband was an I.T. guy and knows how to get in the computer to see all that stuff. He was A+ certified and was licensed to do all sorts of things on Windows computers. SO we have access even if they think they've hidden it.
As they've gotten older we still having allowed them to have phones. They don't need them. Friends can call our land line or cell phones. If they want to text/message/IM or anything it's on a device we can access.
As for the photos of the girl, I'd have been on the phone to the police and filed charges. That family should be caught allowing that sort of stuff and it be something everyone finds out about. Naked girls sending photos over the internet is illegal and punishable by all sorts of things. No leniency from me. If it was my kids they have sore butts along with the legal troubles. AND I'd be personally thanking the family that called the police on my kids because that will teach them what is not appropriate and that they'll always get caught.