cleaning, converting to imagebuf, etc