[PATCH u-boot-marvell v3 23/39] tools: kwbimage: Refactor image_version()