working code, batchjpeg.py can work on folder or just one file