deleting images duplication with javascript