Fixed bugs for the generation of spectrum image.