You have to tell your friend, straight up, man to man. If you don't... well that makes you a dickhead.
On the personal note, I think you are a putz, only because you call him a friend and seem to value how often you can crack a beer open with him over his right to privacy and sanctity. When strange shit goes down, I put myself in the position of my friend and think how would they react with this knowledge? Not their reaction to me, but what would they have to do. "He'd have to show his girl to fix this shit..." So I'd tell him.
Now then, did you know it was her before you started cranking one out? Based on the order you phrased the original post... it sounds like, "Yeah I did." If this is the case, then you are a scum bag, a rung below the creep that took these pictures to begin with. And I think you should tell your friend, "I cranked it to the pictures for a few days before telling you." Say I'm wrong.
- Instead of voyeurism:
- Get a girlfriend you trust
- take some money shots of her when she doesn't know it
- show her the pictures
- have angry sex.
- Not complicated. And don't post them online unless she is down with it.