[U-Boot] [PATCH v2 12/45] image: Move hash checking into its own function