X-ray photoemission study of Gd, Tb and Dy 4f and valence bands