Direct observation of domain-wall pinning at nanoscale constrictions