Better image verifiation.
this is a cherry-pick (with one minor obvious conflict fixed) of the commit that was written by @rln in feed/openwrt-core
this is a cherry-pick (with one minor obvious conflict fixed) of the commit that was written by @rln in feed/openwrt-core