Adding logic for images.