Revive the -r option.

The -r (read list of image files/folders from stdin) went missing somewhere between the 1.0 and 2.0-pre release. This re-adds it (mostly with code taken from the 1.0 source). See issue numbers 21 and 22 for discussion.