thanks to a tipoff by labisso, converted it to use a ThreadLocal so that
each thread has its own seperate context.  Good chance of meeting our
needs now.

also added a image support change, that seemed required.