The electrostatic image potential in metal semiconductor junctions