Merge similar images in PDF