The effect of nonlinear gradient terms on localized states near a weakly inverted bifurcation