open image; get image_width; if (image_width > (150 * 4)) { change_image_size to "25%"; } change_image_size to final_thumbnail_size; print_image;