Fixed potential bug in images.py.

- This only happens on some versions of matplotlib.