More efficient count of double images and better HTML/CSS structure