Fix dpi calculation