1. A method of stabilizing an image generated by an optical microscope comprising: (a) applying a light source to a sample and a fiduciary element held on a nanopositioning stage, the sample comprising a target element and having a positional drift; (b) detecting photons emitted from the fiduciary element and the target element with an image sensor, wherein the photons emitted by the fiduciary element and the target element are detected by the same image sensor; and (c) correcting the positional drift of the sample using an algorithm configured to calculate the location of the fiduciary element and having closed-loop feedback control of the nanopositioning stage, thereby stabilizing the image, wherein the fiduciary element has an imaged point spread function, and wherein the algorithm calculates at least one of an arithmetic center-of-mass on the imaged point spread function to locate the fiduciary element, a center of any least-squares fitting to a Gaussian distribution on the imaged point spread function to locate the fiduciary element, and the center of a Gaussian distribution using a Maximum Likelihood Estimator calculation method on the imaged point spread function.