Stopped shadowing "dir" in _find_jpgs_in_dir.
Some PEP8 corrections.