Getting the image of a texture node that feeds into a node group
This is done with searching the node links for one that connects into the node input. The image node is on the other end of that link:

import bpy

mat = bpy.data.objects["Suzanne"].data.materials[0]

# get node input (socket)
socket = mat.node_tree.nodes.get("MyNodeGroup").inputs[0]

# get node link that connects into the socket
link = next(link for link in mat.node_tree.links if link.to_socket == socket)
# get the other node of that link
node = link.from_node

# get the image from node
image = node.image