Gamma ray spectroscopic studies of states in neutron-deficient Pb and Tl isotopes