Remove MAXIMPERSOURCE and replace by nset and number of images in the chi2 computation functions

Losing space and time because of it