Both p and d hashes fail to detect matching images. Images might have something else having been done (downscaling with bad sampling?) which confuses the hash calculation.
Image B)
https://finna.fi/Record/museovirasto.841efcc6-bbd3-47b1-b48a-8b502fc13d4e
Image was uploaded from B to A, downloading both and trying to match the images fails in the python module (too much difference for identical images?)
This is likely a bug somewhere in the python module.