Validator - upload files

Can you please advise me how to define a validator form, where I have the option to attach multiple files and only the mimetype image/jpeg is allowed.

For one file is:

     $validator
        ->allowEmptyFile('image_teaser')
        ->requirePresence('image_teaser', 'create')
        ->uploadedFile('image_teaser', [
            'types' => [
                'image/jpeg',
            ],
     ],".jpg");

Do you need multiple image_teaser files, to create a new record for each one? Or do you have multiple different fields in a single record that you need to upload for all at once (e.g. a teaser image and a banner image and a footer image)? The solution is quite different for those two scenarios.

Also, can you share what this part of your form currently looks like?

The form:

echo $this->Form->control('image_gallery[]', [
    'label' => 'Galery *.jpg',
    'type' => 'file',
    'multiple' => 'multiple',
]);

And the validator should verify that only * .jpg files are selected