Minimum distance between the same images to avoir repetition implemented