Hello,
First of all please note that
masturbation directly not responsible for depression.
masturbation is a natural process done by 90% males of the world in lifetime.
In your case your masturbation has become compulsion , that's why it is problematic for you.
After seeing just a sexy photo, you have to masturbate that is the problem. If you do not masturbate, you feel dis-comfortable and anxiety.
You can sure be helped by psychiatrist.
You can be treated for your compulsion (compulsory masturbation) by specific
psychotherapy like Cognitive behavior Therapy(CBT) , Exposure and prevention technique and so on. There are also medicines which can help you in treatment like some anti anxiety medicines(
Clonazepam,lorqazepam) and SSRI (
Fluoxetine, sertraline etc). Even these medicines can help in night fall also.
So without waiting
consult psychiatrist and get rid of your problem.
Hope I have answered your query.
Regards,
Dr. Chinatn Solanki.