Added saving images to the global strcture