tools: Return unique error code in img_cmp