Based on some of the articles I have read, Google has thrown a lot of resources at the problem and now have hashes that are capable of identifying certain photos even if they have filename changes, resolution changes, and and so on.
It does not sound like too difficult of a problem - instead of relying on SHA5 file hash, run an it through a program that gives you an array of what the image would look like when displayed and then hash that. Use some margin of error to take into account compression, etc. and you could say with some confidence that one file is the image in question, even if the original JPEG is now a half-resolution GIF.
Of course having the resources to run that on every single image that goes through Gmail's servers is another issue entirely.