We prove a version of Bourgain's projection theorem for parametrized families of C2 maps, which refines the original statement even in the linear case by requiring non-concentration only at a single natural scale. As one application, we show that if A is a Borel set of Hausdorff dimension close to 1 in R2 or close to 3/2 in R3, then for y E A outside of a very sparse set, the pinned distance set {lx - yl : x E A} has Hausdorff dimension at least 1/2 + c, where c is universal. Furthermore, the same holds if the distances are taken with respect to a C2 norm of positive Gaussian curvature. As further applications, we obtain new bounds on the dimensions of spherical projections, and an improvement over the trivial estimate for incidences between 8-balls and 8-neighborhoods of curves in the plane, under fairly general assumptions. The proofs depend on a new multiscale decomposition of measures into "Frostman pieces" that may be of independent interest.