exit imagecreation if fails