Fixed image saving bug.