Metal-insulator transitions in metal clusters: a high-energy spectroscopy study of palladium and silver clusters