Add ImageDatabase.getImageByHash().
Minor cleanups.