Passports have your photo in it. Don’t passport checkers compare your face with the passport photo?
In some of these countries they are more concerned about collecting an entry fee or returning stupid paper work. I know they don’t look very hard at pictures. In one country, the Guy was looking at the picture on my Brasilian VISA.
There are people who can change passport photos skillfully enough that a microscopic exam would be necessary to detect to fraud.
In the old days, it was possible to replace the photo. If they don't check against a database, as well as against your face, they are accepting the passport at face value. Or, they may just be checking that it's a valid number.