Change code for log file and image directory
Add __pycache__ to .gitignore