make some variables global
refactor out jpeg marker extraction from quality estimate
jpeg quality output, bit of cleanup