Minor refactorings.
Adjusting spectral images insertion.