Added file mimetype validation for optimizers.