Instead of setFormTypeOption, new formalism is now using setFileConstraints like :
ImageField::new('mainImage')->setFileConstraints(
new File([
'maxSize' => '10M',
'mimeTypes' => [
'image/jpeg',
'image/png',
],
'mimeTypesMessage' => 'Please upload a valid image.'
])
),
(source : https://github.com/EasyCorp/EasyAdminBundle/pull/6258#issue-2241587520 )