Also add a map of the hashes. When a caller looks up an image with a distance of zero, short-circuit the full loop of the database and simply return the set that already exists.
Also add a map of the hashes. When a caller looks up an image with a distance of zero, short-circuit the full loop of the database and simply return the set that already exists.

tlianza/imghash