Local manifestations of thickness-dependent topology and edge states in the topological magnet MnBi2Te4