Fix LazyImage is spawning too many threads.

Improve debug info code.
Fix structure of threading codes.