[PATCH imagefactory 19/32] Invert some exception logic to make the code shorter.