add jpg to the formats, and then add a check for `has_pil` in `_figure_format_changed`, such as:

```python
def _figure_format_changed(self, name, old, new):
    if new == 'jpg' and not has_pil:
        raise TraitError("Require PIL/Pillow for jpg figures")
```