migrated saveType to ImageBuf object