M.G.
We have had the odd friend of my eldest son's in particular (he's quite naive) who has not treated him very well. Early on, I discouraged friendships like that after he'd been burned once or twice. I let him figure it out on his own, but when I knew he was upset, I'd remind him of his friends who treated him great and I'd encourage those friendships. Those were the kids I was happy to have over. I didn't allow the kids who were mean to him, over.
He has a friend at the moment who he says is a good kid, although this kid's other friends are into drinking and drugs, and just bad behavior (suspensions in school etc.). We've had issues with this kid in the past. He came over once and his buddies (these kids I'm describing) all showed up within an hour wanting to use our pool. Nope.
I am really firm on stuff like this - I'm the parent, I have final say. My kid actually likes it - that he knows I'm looking out for him and I will be tough - because he likes limits. I grew up without enough limits, and I got into all kinds of trouble. In my case, my father was ill, so there just wasn't enough parental supervision. But I would assume it would be the same if a parent was too lax.
I would tell my child I'd seen the photo, and that I have concerns. I'd open it up like that. If it's posted on the internet, you're not snooping. You are supposed to be checking for this kind of stuff. You're not invading her privacy - it's on the net.
I don't think you failed her. Kids experiment and as you say, are sometimes drawn to kids that you have concerns about. I use them as learning experiences. I think the fact that you care and want to do something shows how good you are as a mom. It's the ones who think their teens are angels and naively assume just because they don't see anything, it's all ok - are not really involved enough in their kids' lives. That's where you run into problems.
Rules are good. So is saving your daughter from more consequences from behavior like this (pictures, etc.). Take your feelings out of this (don't take it personally) and just guide her.
ETA: Nervy - love what you wrote about 'it's important for parents to 'be the wall that children push against', to be a strong wall and understand that if we parents fail to keep that wall up while the child is pushing against it, the child will fall.' '