> Do people choose realtors based on their photo?
Yes, but not consciously.
> Perhaps it's just some custom that's been passed down
I'm sure they have tested ads without photos, or with photos of something other than people, and found that photos of attractive smiling real estate agents work best.
If it surprises you that this works, I recommend reading Influence: The Psychology of Persuasion by Robert Cialdini. He is a psychologist who has spent years not just studying persuasion in laboratory settings, but "going undercover", taking courses and even doing jobs in all kinds of persuasion professions - door-to-door salespeople, fund-raisers, recruiters, advertisers, etc. He noted hundreds of techniques that he was taught, or that he learned or observed, and categorized them into six principles of persuasion, each forming a chapter of the book.
The book is useful to entrepreneurs who need to market their startups, and useful to humans, who need to understand the techniques that are being used by sales people and marketers of all kinds. I recommend it to everyone. (In case you're worried, Cialdini doesn't recommend unethical techniques, though he does describe some so that you know what to watch out for.)