Set active image node with python
Here is an example that creates a Texture Image Node for the material Material with Python:

import bpy

node_tree = bpy.data.materials['Material'].node_tree

node = node_tree.nodes.new("ShaderNodeTexImage")
node.select = True
node_tree.nodes.active = node


The new node is selected and made the active node of the node tree.