The error is raised by PIL, which doesn’t seem to support the BILINEAR resize option for this type of image.
From their docs 12:

resample – An optional resampling filter. This can be one of PIL.Image.NEAREST 7, PIL.Image.BOX, PIL.Image.BILINEAR, PIL.Image.HAMMING, PIL.Image.BICUBIC 2 or PIL.Image.LANCZOS. Default filter is PIL.Image.BICUBIC 2. If the image has mode “1” or “P”, it is always set to PIL.Image.NEAREST 7. See: Filters 2.