Thickness dependence of the work function in double-layer metallic films