Can we parse "string" as Driver Variable?
in this method we try to identify the object that is running the driver then we access its properties ( image and file ):


we add a new property to all scene objects this property is their index in the scene objects list ( we need to run this every time we add/delete an object to the scene ) :

import bpy
for obj in bpy.context.scene.objects :
    obj["index"] = bpy.context.scene.objects.find(obj.name)

we pass only the object index to the driver to identify it and access its properties.

import bpy

def change_image(n,min,max,index):
    obj = bpy.context.scene.objects[index]
    val = int(n*10)
    if (min &lt;= val &lt;= max):
        filePath = obj["file"] % val 
        bpy.data.images[obj["img"]].filepath = filePath

bpy.app.driver_namespace['change_image'] = change_image