Silver nanoparticles stabilized with thiols: a close look at the local chemistry and chemical structure