Handling output images in script