MgO/Ag interface structure and STM images from first principles