The aberration-corrected scanning transmission electron microscope has great sensitivity to environmental or instrumental disturbances such as acoustic, mechanical, or electromagnetic interference. This interference can introduce distortions to the images recorded and degrade both signal noise and resolution performance. In addition, sample or stage drift can cause the images to appear warped and leads to unreliable lattice parameters being exhibited. Here a detailed study of the sources, natures, and effects of imaging distortions is presented, and from this analysis a piece of image reconstruction code has been developed that can restore the majority of the effects of these detrimental image distortions for atomic-resolution data. Example data are presented, and the performance of the restored images is compared quantitatively against the as-recorded data. An improvement in apparent resolution of 16% and an improvement in signal-to-noise ratio of 30% were achieved, as well as correction of the drift up to the precision to which it can be measured.