fixed various issues in strip_images_for_save