revise printPictures to filter duplicate images