Transfer image masks when when possible, instead of copying.