adds debug logging to track down jpg->jp2 issue.