function clearImageLayer(layer) {
  // get layer fill
  let fill = layer.style().fills().firstObject()
  if (!fill) {
    fill = layer.style().addStylePartOfType(0)
  }
  fill.setFillType(4)
  fill.setPatternFillType(1)

  // set placeholder
  let imageData = getImagePlaceholder(layer)
  fill.setImage(imageData)

  // remove metadata
  removeLayerMetadata(layer)
}
Clears the image layer.

@param {MSShapeGroup/MSBitmapLayer} layer