Extract image manipulation methods

Change-Id: Ia261740fa168f157e62ae3b9ff45861b1bd6473c