image: Split hash node processing into its own function