The concept is based off the Gemara in Rosh Hashanah 24b which discusses what one is allowed to make pictures of. When it discusses making pictures of humans it writes:
אֶלָּא מֵעַתָּה פַּרְצוּף אָדָם לְחוֹדֵיהּ תִּשְׁתְּרֵי? אַלְּמָה תַּנְיָא: כׇּל הַפַּרְצוּפוֹת מוּתָּרִין חוּץ מִפַּרְצוּף אָדָם! אָמַר רַב הוּנָא בְּרֵיהּ דְּרַב אִידִי: מִפִּרְקֵיהּ דְּאַבָּיֵי שְׁמִיעָא לִי: ״לֹא תַעֲשׂוּן אִתִּי״ — לֹא תַּעֲשׂוּן אוֹתִי.
The Gemara raises a difficulty: However, if that is so, let the fashioning of an image of a human face [partzuf ] alone be permitted. Why, then, is it taught in a baraita: All faces are permitted for ornamental purposes, except for the face of a person? Rav Huna, son of Rav Idi, said: From a lecture of Abaye I heard that there is a different reason why one may not form an image of a human face, as the verse states: “You shall not make with Me [iti]” (Exodus 20:19). This can be read as: You shall not make Me [oti]. Since man is created in the image of God, it is prohibited to form an image of a human being. (William Davidson translation and notation)
The SA YD 141:4 writes:
וכן צורת אדם לבדו כל אלו אסור לעשותם אפילו הם לנוי
And similarly, the figure of a human being. The production of any of these are forbidden even if only being produced for ornamental value.
Likewise, the Tur, YD 141 echoes this sentiment:
אלא בשאר צורות ופרצופין אבל כל אלו אסורין בכל ענין בין לעשותן בין להשהותן
But all other images and that of a human face - all of these are forbidden in any matter whether making or whether hanging...
With this in mind several acharonim take a hardline against hanging photos in their home.
For example, refer to HaRav Moshe Shternbach shlita in Teshuvos Vehanhagos 3:263 (who speaks about taking a trip to a museum and seeing all the photos etc.) who mentions that any drawing whether embossed or debossed/depressed, and even photographs are problematic. He notes how he knowknows of many tzaddikim who were actively against having photographs as they viewed it as "מזיק" - i.e. some form of (spiritual) damage/degradation. However, he notes that most people nowadays are lenient and taking photos involvedinvolves some form of grama (indirect action) which makes it okay. That being said, he does warn against it:
משום שמזיק לנפש שעי"ז עלול ליתפס רוח טומאה על התמונה
Because it is harmful to the soul that through this it is likely that an impure spirit may catch on the image.
Although, he does say that it is allowed to have images of tzaddikim as they go in the way of Hashem etc.