The only times I've gotten dupe photos were after returning a lost item to them. If you have high friendship with a particular villager, you can click on "investigate" on the lost item in your inventory and it'll give you a hint as to whose it is. If you give it to the right villager without asking for help, there's a higher chance of them giving you their photo in return. Today Megan gave me another copy of her photo after doing exactly this, and the same thing happened with Judy like 2 weeks ago when I still had her.
ofc there's still a chance of them giving their photo to you in exchange for any high-value gift like usual.
edit: wait, forgot that Cyd gave me a dupe of his photo after giving him a wrapped apple (not my native fruit). Honestly it's not too hard obtaining dupe photos tbh.