I used the example at http://snippets.dzone.com/posts/show/2469 to
download some pictures, the "wb" is important, so that the file is
opened in binary mode, otherwise you'll end up with ascii mode and
your file contains corrupted data.