Assigning Image to lineItem? Our Shop-Customers should upload an image per Item they add to the basket. I managed to upload the image and insert it to an asset folder.

How can i assign the image to the lineItem (maybe as an option)?

This didn't work, as options is not writable:

craft()-&gt;on('commerce_lineItems.onBeforeSaveLineItem', function($event){
    $imageId = craft()-&gt;ultraschall-&gt;uploadCustomerImage(); // add image to asset folder
    if(isset($imageId) &amp;&amp; is_numeric($imageId)){
        $lineItem = $event-&gt;params['lineItem'];
        $lineItem-&gt;options['imageId'] = $imageId;
    } 
});
I got a solution. 
You can't overwrite array elements at this point, but the whole array. I also found it better to use the event "commerce_cart.onBeforeAddToCart".
My working code is now:

craft()-&gt;on('commerce_cart.onBeforeAddToCart', function($event) {
    $imageId = craft()-&gt;ultraschall-&gt;uploadCustomerImage(); // add image to asset folder
    if(isset($imageId) &amp;&amp; is_numeric($imageId)){
        $lineItem = $event-&gt;params['lineItem'];
        $options = $lineItem-&gt;options;
        $options['image'] = $imageId;
        $lineItem-&gt;options = $options;
    }
});