Fixed a problem when mpi4py not available
Fixed some problems caused when switching to imagen module