Adaptive control of modes in multi-mode fibers for imaging and communications