This question is a recurring one: Which is better a prime or a zoom? Posed as such, there is no unique answer. Even if one narrows it down to image-quality only, there is still no single answer. Based on experience with hundreds of lenses, we have seen primes which show better image-quality than zooms just like we have seen zooms which show better image-quality than prime lenses.
While high-quality prime lenses are usually sharper than zooms at the same focal-length and aperture, mostly at wider apertures when the sensor out-resolves the lens, this is not always the case. At one point, a lens can out-resolve the sensor and then you will see equal sharpness in images despite a potential difference in lens sharpness.
If someone were to build a prime and a zoom today with the best technologies, then the prime would produce better image-quality since there are fewer variables in its design. However, when comparing lenses introduced at different times and quality levels, they must be compared case-by-case.
Manufacturers choose to use different qualities of materials, different designs and tolerances which sets the price-point of lenses. That is why you see standard zooms which are very soft at their widest apertures. while premium zooms can be extremely sharp even wide-open.
When buying a lens, in order to choose between suitable prime and zoom lenses, one must compare the quality and results from these very lenses instead of blindly assuming that primes beat zooms. Plus, in many cases, image-quality is not everything. One has to see the range of focal-length and aperture and decide which one is more desirable.