Added the capability to save spectra and images