tools: mkimage : bugfix returns correct value for list command