fixed scope for saveImage