Added environment checks
Added a login.cfg template file
Added threshold to jpegoptim