A slab metamaterial lens with a refractive index of -1 is capable of producing a perfect image, since it transfers all the plane waves from the object plane to the image plane without creating any distortion in their amplitudes and phases. However, its practical implementation encounters several challenges. In this paper, a lossless slab metamaterial lens is investigated using the ray-tracing technique. We also discuss propagating waves and evanescent waves and investigate an imaging system based on an ellipsoidal cavity. It is shown that since an ellipsoidal cavity transfers the beams from one of its foci to the other with the same amplitude and phase, it acts similarly to a metamaterial slab lens of n=-1. Therefore, this structure can be used as a subwavelength resolution imaging system. Also, it does not suffer from chromatic aberration, since all the rays transmitted from one focus pass through the other independent of the wavelength. Another important advantage of this system, compared to metamaterial-based superlenses, is that it can operate at any frequency as long as the dimensions of the cavity are much larger than the wavelength.