Nanoscale nuclear spin imaging: Dynamical decoupling and diffraction in a magnetic resonance force microscope