Remove layoutStr, since it's only used for printing verbose output.
Move the debugFilename onto the saveDebug function.
Restore the warning, pkt needs to be initialized or it'll fail to write.
Only save the debug images when the right verbosity is set.
Clear up the saveDebug function calls.