Mock image object properly in tests for volume tasks