Fix UnboundLocalError when a datasource of the wrong shape is looked for

We should raise a proper exception when the shape isn't correct as opposed to let an UnboundLocalError occur.
These tests pass, but I'm guessing that these two `plot.plot` calls should've been `plot.img_plot`. (The data for `y` raises a *different* `ValueError` when called with `plot.plot`.)