adding check duplicates images functionality