if statement to image