Two Image labels for Multitask learning problem

Hello fastai community,
I’m having trouble for creating a databunch for multitask learning:
My input images is gray image,shape(1,height,width)
My target label is two image:
1: first label is a colorful image,shape(3,height,width)
2: second label is a mask image, shape(1,height,width)

And i have tried combine these two label image into single image as one label, but the problem is that
when i resize each image, the default resize Interpolation is bilinear, and it will destory my mask information. However i don’t find a way to change the interpolation method in ImageImageList class. how do i solve the problem.
HELP WANTED!

In the previous version of fastai it is rather difficult to get what you want. I know it should be possible though but I do not currently know how. But the thing I do know is that doing this with DataBlock API in fastai v2 is super simple because different transforms and classes have been defined which act differently on your image and mask and adapt their behavior accordingly (like the one you said about interpolation). So maybe you could give that a try

Unfortunately,My project is based on fastai==1.0.51, i was wondering that could i write a pytorch dataloader and then using these dataloader to create a databunch, so that i could do some transfroms when the datasets was creating. Is there anything what i should pay attention to?