How do I get the image index that matches the material texture? I see that the index order changes depending on the image name
Assuming the image of interest is on the first texture of the first material of the active object and you're using the Blender Internal (BI) render engine (not cycles):

import bpy

print( bpy.context.active_object.data.materials[0].texture_slots[0].texture.image.size[:] )