Added conditions to image wrap