You seem to be using the API incorrectly. The signature of sfForm::setValidator() is here.
However, here's a simple way to set a file validator that allows only web images to be uploaded:
$this->validatorSchema['my_file'] = new sfValidatorFile(array(
'mime_types' => 'web_images'
), array(
'invalid' => 'Invalid file.',
'required' => 'Select a file to upload.',
'mime_types' => 'The file must be of JPEG, PNG or GIF format.'
));
The 'web_images' category includes the following MIME types:
image/jpeg
image/pjpeg
image/png
image/x-png
image/gif
If you want to explicitly define the MIME types to accept, replace 'web_images' with an array of types like this:
'mime_types' => array(
'image/jpeg',
'image/pjpeg',
'image/png',
'image/x-png',
'image/gif'
)