assign an id to number of failed images and check using DOM