Avoid KeyError, fix logic of getting default value

Line triggered KeyError if 'resample' was not defined, the existing way of using Image.ANTIALIAS as default was not working.