Used enumerate() instead of a counter variable.
More path functions.
Implemented the ImageFormats enumeration, and some other minor changes to the parameters.