Variable-length signature for near-duplicate image matching