Add ndim checks in filter.edges

This addresses #1147, treating it the same way `feature.canny` does:

```python
    if image.ndim != 2:
        raise TypeError("The input 'image' must be a two-dimensional array.")
```