Fix bug when handling hashes on JPEGs