Of course, that only gets you 1:1 matches. You might consider ones that are the same but different sizes, or colors. So you might want to scale the images to a standard size (not relevant for the case you mention that are already the same size) or convert to gray scale. Generate the hash for the sub-subsampled images.
The other potential issue (again, not in the case you mention below) is JPEG compression differences, so in that case you are better to reduce to a much smaller size and compare that.