We present a new scheme of quantum memory for optical images (spatially multimode light fields) that allows mapping the quantum state of the signal onto the long-lived coherence of the ground state of an ensemble of stationary atoms or impurity centers. The memory medium is embedded in an optical cavity with degenerate transverse modes, which increases the effective optical thickness of the medium and allows one, in principle, to store information in optically thin atomic layers. Since, in reality, storage and retrieval of limited-duration signals, including signals shorter than the lifetime of the field in the cavity, is of interest, we do not use the low-Q cavity approximation. The influence of losses due to partial reflection of the nonstationary signal field incident on a coupling mirror on the storage efficiency is considered. We used the method of approximate impedance matching, wherein losses due to reflection can be minimized by controlling the coupling parameter of the light field with memory medium in time, thus creating conditions for destructive interference of the signal and local fields on the coupling mirror. The influence of diffraction on the transverse resolution of memory at the writing and readout stages is investigated, and the number of effectively stored transverse spatial modes of the signal is estimated.