Move image handling diagnostics to extension module.