[PATCH u-boot-marvell 22/29] tools: kwbimage: Refactor image_version()