finished chi2barycenter version and resolved faulty nimageset bug
Former-commit-id: c3a676de1d1f0b4a48f63a0c4b3f22211924ea01