Pygmy and giant electric dipole responses of medium-heavy nuclei in a self-consistent random-phase approximation approach with a finite-range interaction