Thin film quantum size effects: I. The effect of defect structure at the vacuum/film interface