Hi... If this incident happened long ago and it is still troubling you in your mind to an extent of causing suicidal ideations. You must immediately consult a Psychiatrist and if required take the medication to prevent a negative consequence. In terms of the causes I believe this was a traumatic experience for you to be embarrassed infront of the whole community (college/hostel) and being shamed by your hostel mates. Masturbation is normal and there is no shame in it. The problem lies when your room mate took a photo and circulated in the hostel. This amounts to sexual harassment which is a legal offence as well.
Next Steps
Consult a Psychologist.
CBT along with Interpersonal Guidance and Counselling is required.
Health Tips
Mr. Gunjan Maithil
Senior Psychologist
Cell: nine six seven one three zero three one three four
Website: https://gunjanmaithil.wixsite.com/therapy
App: http://wix.to/fECHB08?ref=cl