For instance, here's a US pharmacy chain – notice it mentions photos on the home page.
They're "convenience stores" in the sense that they also sell things like soap, laundry detergent, toothbrushes/toothpaste/floss/mouthwash, paper towels, toilet paper, cleaning supplies, etc. It has nothing to do with getting people to buy more drugs, it's just another thing to sell. Stores in the US tend to be bigger and stand alone, so if you've got a sizable building you want to fill it with something to sell.
Since someone will go there to get their prescription filled or pick up some Asprin, it makes sense to start selling vitamins, then some household essentials, and before you know it Walgreens is selling fruits and veggies.
Pictures being printed in pharmacies have been around since 90s, at least.
However, I've not been able to find any evidence of this. It could just be a just-so story.
...Why does a pharmacy print photographies? I've never heard of a pharmacy selling something that isn't drugs.