Wettability Characterization from Pore-Scale Images Using Topology and Energy Balance with Implications for Recovery and Storage