Prohibition of taking photographs of living beings unless when necessary

Q: Looking through "Sahih Al-Bukhari", I read the following words from the Messenger (peace be upon him), Every Musawwir (those who make pictures, photographs, and statues) will be in the Fire. I have worked as a photographer for 18 years, taking photos of people, animals, and other living beings. I am now working in the photography department of a munitions factory and take the photographs that are required by the factory for its publications and other reasons. Since I came across this Hadith I have been feeling very afraid, so I hope that Your Eminence will give me a Fatwa on this matter. Please bear in mind that I have been earning my living from photography for 18 years and that is still my source of income.

A: Firstly: Taking photographs of beings with a soul, whether they are people or animals is Haram (prohibited), unless it is an obligatory necessity, such as the photographs used for ID cards or on a passport for someone who has to travel, or photographs of criminals (Part No. 1; Page No. 723) or people involved in incidents that endanger security, so they can be identified and arrested when this is required. Secondly: There are many Halal (lawful) ways to earn money and it is incumbent on Muslims to choose ways that are far from what Allah declared as Haram and avoid the doubtful. May Allah make things easy for you and for us and lead us all to the way of guidance and righteousness. As for what is in the past, we hope that Allah will forgive you for this and we advise you to perform sincere Tawbah (repentance) to Allah.May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.