changed resize to resample, if not working, here the culprit