Hmm what you describe conflicts with what u/m0dest mentioned above. I'd like to hear word from him/her about the matter. If your friend's content wasn't shared, the the image must have been someone processed for known nudity patterns
I suppose Microsoft started using some fuzzy/NN/heuristic/etc. pattern matching algorithm to identify pornography, so it caught the photos my friends uploaded even if they didn't came from a know database.