Structure and stability of metallic nanoparticles