Recalculate image users after user_remap
The subject is more a Python problem than a Blender problem except for some points I'll try to explain below:

Original code:

def cleanup_images(case='none'):
    import os.path
    for image in bpy.data.images:
        filename =  os.path.basename(image.filepath)
        correct_index = bpy.data.images.find(filename)

        if correct_index == -1:
            image.name = filename
        else:
            #May remap an image on itself
            image.user_remap(bpy.data.images[correct_index])


The problem of that is an image can be remapped on itself, and if you do that, the image looses its user = 1 which becomes 0 (this is the point to report to the bug tracker in my opinion or at least documented).

Second attempt, I though that enumerating may be the solution:

def cleanup_images(case='none'):
    #rename all images to their filename
    import os.path
    for i, image in enumerate( bpy.data.images ):
        filename =  os.path.basename(image.filepath)
        correct_index = bpy.data.images.find(filename)

        if correct_index == -1:
            image.name = filename
        elif i != correct_index:
            image.user_remap(bpy.data.images[correct_index])


But this does not work, very possibly because user_remap may change the indexes so that some images continue to remap on themselves.

Correct code:

def cleanup_images(case='none'):
    #rename all images to their filename
    import os.path
    for image in bpy.data.images:
        filename =  os.path.basename(image.filepath)
        correct_index = bpy.data.images.find(filename)

        if correct_index == -1:
            image.name = filename
        else:
            correct_image = bpy.data.images[correct_index]
            if image != correct_image:
                image.user_remap(correct_image)


We no longer use index but direct objects comparison to apply user_remap.

For information, an alternative approach with no use of indexes:

def cleanup_images2( case = 'none' ):
    from collections import defaultdict
    import os.path

    #Organize images by filepath
    toClean = defaultdict( list )
    for i in bpy.data.images:
        toClean[i.filepath].append( i )

    for key, value in toClean.items():
        #image to keep is the first
        toKeep = value[0]
        #the other ones are remapped to the first
        for i in [i for i in value if i != toKeep]:
            i.user_remap( toKeep )
        toKeep.name = os.path.basename( toKeep.filepath )