imagetruncation stuff added.