Enclose add_image_size within a function