Recently I had to clean up a lot of my blendfiles. Especially when you append objects that share textures with your existing objects, you wind up with a lot of duplicates.
So I came up with a little script to unlink every image in the file. You can manually link the images to your textures again, and they will not get deleted next time you open your blendfile.
bpy.data.images will store all images' names that are used in any texture in an array.
The for loop will be repeated as often as there are image names in imgs.
user_clear() is a built-in method, which will set the number of users of an image, texture, datablock etc. to 0.
Some people may ask: what if I want to keep some of my images? Of course this is a good question. You could "tag" the images you want to keep by hand, by inserting a string at the beginning, let's say "keep".
Then use an if statement, so we only delete those images whose names do not start with "keep".