Make doEdit compatibile with extended Image class

Add a write operation for the $item as well to ensure that if the Image has an extension (like FocusPoint) changes are saved.