Evolution of the pygmy dipole resonance in nuclei with neutron excess