Added the image and SED chisqrd capabilities and other small fixes.