Metal detectors and X-ray inspection systems for the inspection of confectionery, snacks and small pastries