   if image
     action =
       action: 'removeImage'
-      variantId: variant.id
+      variantId: getVariantId variant
       imageUrl: image.url
   action
 

    # patch 'prices' to have an identifier in order for the diff
    # to be able to match nested objects in arrays
    # e.g.: prices: [ { _id: x, value: {} } ]
    patchPrices = (obj) ->
      _.each allVariants(obj), (variant) ->
        if variant.prices
          _.each variant.prices, (price, index) ->
            price._id = index

    patchPrices(old_obj)
    patchPrices(new_obj)

    isEnum = (value) -> _.has(value, 'key') and _.has(value, 'label')


      if REGEX_NUMBER.test key
        if _.isArray value
          v = helper.getDeltaValue(value)
          id = getVariantId old_variant
          setAction = buildNewSetAttributeAction(id, v, sameForAllAttributeNames)
          actions.push setAction if setAction
        else
