handling problems in image saving 2