Move resource hash checking to saveResource