Java Program for hashing images