Looking at pictures of women led him to commit the “secret vice”
Question

What is the ruling on looking at pictures of promiscuous women and then doing the “secret vice” (masturbation) for fear of falling into zina (fornication) or homosexuality? May Allah reward you with good.
Praise be to Allah.With regard to the ruling on looking at naked pictures, please see question # 8861.
With regard to your committing the “secret vice”, your looking at something haram led you to commit another haram action. Perhaps it may lead you in the future to commit one of the major sins – Allah forbid – such as fornication or homosexuality.
Doing the “secret vice” is haram. It is important that you see question no. 329.
What you have to do is to repent to Allah from the sins that you have committed, and keep away from every haram thing that may provoke desire. You will not find any better means than fearing Allah, then protecting yourself by means of marriage. If you cannot get married, then you have to fast, for it will be a shield for you. This is the advice of the Prophet SAWS (peace and blessings of Allah be upon him) to young men. Try not to be unoccupied as far as you can, and seek the help of Allah. And Allah knows best. May Allah bless our Prophet Muhammad.
Al-Akhlaaq (characteristics) – al-Akhlaaq al-Madhmoomah (Blameworthy characteristics) .