Perceptual image hashing for PHP