Hysteresis correction of scanning tunneling microscope images