imagex.c: Fix use of uninitialized variable in error path