removed extraneous comments from imaging code and added some debug output