Inhomogeneous Light-Matter Coupling as a Resource for Noiseless Quantum Memories