Fix hash generation to check if image was already resized

Old implementation did created different md5 hashes for the same image. So the images got regenerated on every jekyll build.