Added perceptual hash (phash) functions