Protect against crashes when attempting to resize tiny images