I don't think you have anything to feel ashamed of! There's nothing wrong with trusting a friend you probably cared about, it's their fault and their problem that they betrayed that trust. It's a terrifying experience to feel your social circle, people who might have been friends, behave in such a mean way, and use a moment of vulnerabilty where you felt sexy for a second, to hurt you and make you feel awful. It is going to make it very hard to trust people after that.
At this point if that image resurfaced, it would be a different situation, and I'd think that maybe that your social circle is less likely to be as big and closed-in as a high school and that people would be more mature than behaving that way. With more time behind you I think it's worth being angry at the people who share a nude image from your childhood. You might even find that you can be confident enough to expect the people who are supposed to care about you, like your parents, to support you if you are being hurt, even if the circumstances would be uncomfortable.
With the support of your friends and maybe a bit more time to recover from what sounds like a horrible high school experience, I think it's quite possible that even an unexpected situation like that would be something you can handle.
I'm so sorry you're having to feel this because of what those people did in the past though!
"In between two tall mountains there's a place they call lonesome.
Don't see why they call it lonesome.
I'm never lonesome when I go there." Connie Converse - Talkin' Like You