Now we have real command-line argument parsing, rather than hacking it
together with sys.argv. Much better. Also, we use an enum for the file
types rather than hard-coding the extension strings all over the place.
Kinda silly that the help message said you could choose it, but in
reality you couldn't. Now you can.
As an aside: good lord this code is a mess. I have a ton of cleanup to
do if I feel like it.
Updated for Python3, and to get image format directly
Requesting the correct image format direcly makes the request faster,
as PNG is much smaller. This also removes the external dependency on
the Pillow library.
Deprecate 'PIL' and use 'pillow' instead of 'PIL'.
On a clean Python 2.7.12, 'pillow' must be installed manually.
IMPORTANT !
If you previously had 'PIL' installed, then 'PIL' must be uninstalled.
Install 'pillow' only after uninstalling 'PIL'.