Add some debug messages and image visualisation. Still not solved problem with fitting