add phash hamming distance comparison

improve configuration mechanism
update tests