extract the temp image path to a global variable, shared between functions