backport pil resize support tuple fix

gh-4041