`imghdr.what` can apparently read from a byte stream with a second argument
```python
urldata = urlopen(path)
imghdr.what('ignore this', urldata.read())
```
See http://docs.python.org/2/library/imghdr.html#imghdr.what (not the most elegant interface, unfortunately)

Also, it would be nice to move this into a utility function called `image_format_from_path` (or something similar).