Changes of the Nuclear Charge Distribution of Nd, Sm, Gd and Dy from Optical Isotope Shifts