Fixed image saving procedure