Short answer
No text in the Quran or Sunnah says magic is done through photos. Magicians are known to use personal items, as with the hair and comb used against the Prophet ﷺ, so some raqis say a photo can be used too. Either way, magic harms only by Allah's permission, and the adhkar protect you. Do not live in fear of it.
Practising magic is haram and can amount to disbelief. Whether a photo can be a means is unknown and should not be asserted. A Muslim relies on Allah, keeps up the adhkar, and does not accuse anyone without proof.
The four schools agree on this.
Explanation
Magic (sihr) is real. The Quran says the magicians cause separation between husband and wife, then adds that they do not harm anyone through it except by the permission of Allah. When the Prophet ﷺ was affected, the magic was made with a comb, the hair caught in it, and the husk of a palm pollen. So magicians do use personal items.
Photos are a modern question. Some raqis report cases where a picture was used, and others say there is no evidence for it. The Quran and Sunnah say nothing specific, so no one can state as fact that a photo makes you vulnerable. What is certain is that a magician cannot touch you without Allah's permission, whatever item he uses.
What this means for you:
- Keep the adhkar. The morning and evening adhkar, Ayat al-Kursi before sleep, and al-Ikhlas, al-Falaq and al-Nas three times morning and evening are a shield against every harm.
- Be sensible, not fearful. Being careful about who has your photos is fine for privacy and modesty. Deleting every picture out of dread is not needed and feeds waswasa.
- Do not accuse. If someone tells you a relative has "done magic on your picture", do not believe it without proof. That claim is often how fake healers make money and break families.
- Do not go to an 'amil. Anyone who asks for your photo, your mother's name or money to "check" for magic is someone to avoid.
If you are unwell, see a doctor first. If you believe you are affected, see how to remove black magic and keep up ruqyah on yourself.
The evidence
Quran, Surah Al-Baqara 2:102
وَٱتَّبَعُوا۟ مَا تَتْلُوا۟ ٱلشَّيَٰطِينُ عَلَىٰ مُلْكِ سُلَيْمَٰنَ ۖ وَمَا كَفَرَ سُلَيْمَٰنُ وَلَٰكِنَّ ٱلشَّيَٰطِينَ كَفَرُوا۟ يُعَلِّمُونَ ٱلنَّاسَ ٱلسِّحْرَ وَمَآ أُنزِلَ عَلَى ٱلْمَلَكَيْنِ بِبَابِلَ هَٰرُوتَ وَمَٰرُوتَ ۚ وَمَا يُعَلِّمَانِ مِنْ أَحَدٍ حَتَّىٰ يَقُولَآ إِنَّمَا نَحْنُ فِتْنَةٌۭ فَلَا تَكْفُرْ ۖ فَيَتَعَلَّمُونَ مِنْهُمَا مَا يُفَرِّقُونَ بِهِۦ بَيْنَ ٱلْمَرْءِ وَزَوْجِهِۦ ۚ وَمَا هُم بِضَآرِّينَ بِهِۦ مِنْ أَحَدٍ إِلَّا بِإِذْنِ ٱللَّهِ ۚ وَيَتَعَلَّمُونَ مَا يَضُرُّهُمْ وَلَا يَنفَعُهُمْ ۚ وَلَقَدْ عَلِمُوا۟ لَمَنِ ٱشْتَرَىٰهُ مَا لَهُۥ فِى ٱلْءَاخِرَةِ مِنْ خَلَٰقٍۢ ۚ وَلَبِئْسَ مَا شَرَوْا۟ بِهِۦٓ أَنفُسَهُمْ ۚ لَوْ كَانُوا۟ يَعْلَمُونَ ﴿١٠٢﴾
And they followed [instead] what the devils had recited during the reign of Solomon. It was not Solomon who disbelieved, but the devils disbelieved, teaching people magic and that which was revealed to the two angels at Babylon, Harut and Marut. But the two angels do not teach anyone unless they say, "We are a trial, so do not disbelieve [by practicing magic]." And [yet] they learn from them that by which they cause separation between a man and his wife. But they do not harm anyone through it except by permission of Allah. And the people learn what harms them and does not benefit them. But the Children of Israel certainly knew that whoever purchased the magic would not have in the Hereafter any share. And wretched is that for which they sold themselves, if they only knew.
Magic harms only by Allah's permission, whatever means is used.
Quran, Surah Al-Falaq 113:4
وَمِن شَرِّ ٱلنَّفَّٰثَٰتِ فِى ٱلْعُقَدِ ﴿٤﴾
And from the evil of the blowers in knots
We are taught to seek refuge in Allah from magicians.
Sahih al-Bukhari 5763
Sahih... في مشط ومشاطة ...
"In a comb and the hair caught in it."
The magic against the Prophet used personal items, the basis for raqis' caution about such things.
Sahih al-Bukhari 5143
Sahih... إياكم والظن فإن الظن أكذب الحديث ...
"Beware of suspicion, for suspicion is the most false of speech."
Accusing someone of magic on suspicion is forbidden.
Where the ruling is recorded
- Radd al-Muhtar (Ibn Abidin), Bab al-Murtadd, on the magician. Learning and practising magic is haram, and some forms are disbelief.
Checked by our team. For a more accurate answer to your own situation, consult a scholar. Quran translation by Sahih International. Hadith Arabic from the standard editions of the six books and the Muwatta, with gradings as recorded there; the English is our own rendering. Spotted a mistake? Tell us.