Access Violation Error
I think that there is something around this reason:


You take an internal pointer "uv = object.data.uv_textures[0].data"
This pointer is modified/reallocated during "bpy.ops.object.material_slot_assign()"
So "uv[x]" is no longer available


You can instead do something like that:

import bpy

object = bpy.context.scene.objects.active

uv = object.data.uv_textures[0].data  

bpy.ops.object.mode_set(mode = 'OBJECT')

for i, slot in enumerate( object.material_slots ):
    for p in [p for p in object.data.polygons if p.select]:
        p.material_index = i
    #bpy.ops.object.mode_set(mode = 'EDIT')
    #bpy.ops.object.material_slot_assign()
    #bpy.ops.object.mode_set(mode = 'OBJECT')

print( uv[1].image )


Or, of course, access to an available pointer again:

import bpy


object = bpy.context.scene.objects.active

uv = object.data.uv_textures[0].data  

bpy.ops.object.mode_set(mode = 'OBJECT')

for i, slot in enumerate( object.material_slots ):
    bpy.ops.object.mode_set(mode = 'EDIT')
    bpy.ops.object.material_slot_assign()
    bpy.ops.object.mode_set(mode = 'OBJECT')

uv = object.data.uv_textures[0].data  
print( uv[1].image )


... but I don't get the meaning of this loop, as it will assign to the last material at the end (probably because this is an extract of the whole code...).