images to pairwise