Can a image be render on planes through scripting?
The only solution is to save the image that you want to put it on the plane and to load the image from there

texImage.image = bpy.data.images.load("path to your image saved previously in code")