Salukigirl, I wish you would share some of what your niece has said/done in response? Seventeen is pretty "old" for a teen, when she gets to college in a year or out working, that's not going to be under your sister's powers, her actions and their consequences are going to be her own. Mistakes get made when we're teens, that's how we "learn" but what lesson we learn can depend on how the adults respond?
I would have made sure the guy's mother knew but would have wanted my daughter to take some responsibility for establishing and regaining her "personage"? Having the two mothers do all the "work" and "punishing" the "children" doesn't help teach responsibility, in my opinion. If the guy did/did not publish the pictures (depending on what sort of guy he is!) would make a great deal of difference to me.
Adults text appropriate or inappropriate things to their own friends all the time and some of that has to do with our background and natural disposition. If I were a guy and a girl texted me naked pictures of herself, no way would they be "broadcast" because I'm not that kind of guy!

If my daughter were your niece, I would want her to take the opportunity to, in addition to understanding her own behavior, understand that there are different sorts of "others" out there and just because we like/are dared by/don't think about what we're doing with another, "who" the other is is extremely important.
I did not get married until I was 39; had several offers of marriage before then but the guy was not "right" for me! I didn't get married just because I liked the sex or was rebelling against my parents or was lonely, etc., I knew myself better than that and responded to my needs better so when I married, the man was a good guy too, who appreciated me. I'm not talking flowers, candy, or jewels here, I'm talking person-to-person enjoyment. Learning what sort of guy the guy she texted to would make a difference to me, were this my daughter who maybe made an unwise decision for herself.
Yes, older teenagers and young adults starting out in adult life still could use their parents help but it's getting to the point where their parents' dramas need to be reassessed in relation to starting one's own life as an adult. If your sister has not been training her daughter well all along, what she does now will have less effect, just the same as if your niece did this as some sort of protest or illustration of previous poor interaction between the two of them in the past, will not have as great an effect on your sister and her husband and the rest of the family's dynamics as one might wish/hope.
Your niece is almost grown and I would want her to have a more supportive rather than punitive time of it. However, whatever happens will mostly be the straw that broke the camel's back versus seeing the light, at this point. Supportive is better but even supportive might not make a dent YET if the past has not been supportive. I would tell my sister she has a "choice" with how she deals with this, just as she has a choice with each situation in her life and just as your niece and you and me have choices all along. Few choices are double-or-nothing choices though; mostly they just are pattern- or rut-making possibilities.
Make a mistake in a math problem and continuing on can't get you the "right" answer no matter what. But how far you continue can make a difference in how well/quickly/if you can go back and "fix" the mistake so you can continue on in the correct direction.
So far I've only/mostly(?) hear about your sister and her reaction and responses and problems when this whole issue is really your niece's problem? Her response and what she is thinking/doing would be greatly appreciated if you know it.