Adding some logic to the image to deal with small images