Quantum error correction against photon loss using multicomponent cat states