I recently had a need to get all of the images from a subreddit, so I wrote this script to do it, then decided to release it for public consumption. If the syntax highlighting below is hard to read you can get the source here. (I tried to make it look as much like vi as possible, the environment I write most of my Perl in. It came out looking all right, but with some slightly mangled indentation).
It will download any direct image link as well as any single-page imgur link— meaning the links that omit the file extension like this one, and also the ones that use a 13-character filename (those actually link the imgur file to a Reddit post, if you wondered). Galleries and albums will be ignored. Self posts or any other kind of web page will be ignored. Any file without a MIME type of “image” and a file type of jpeg, png or gif will be ignored (you can add additional types if you want).