Added writeImageAtIndex Jython function. [1395]

Workaround for captureImage requiring an "animation_index" XML
attribute.