Add an option to force codegen in imaging mode (#36990)
This allows much easier debugging of imaging mode codegen
without hacks like specifying a dummy output and manually running
module init functions.
Also allows specializing codegen to give result more similar to
code in actual sysimg in this debugging mode. Ref #36974.