Imaging ultracold atomic gases close to surfaces is an important tool for the detailed analysis of experiments carried out using atom chips. We describe the critical factors that need be considered, especially when the imaging beam is purposely reflected from the surface. In particular we present methods to measure the atom-surface distance, which is a prerequisite for magnetic field imaging and studies of atom surface-interactions.