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.