Quantum size effects on the work function of metallic thin film nanostructures