How can I unlink all images from a project? I had a big project that I separated into smaller parts, but in every single file I now have all the images that I had in that one huge project earlier. 

Unity has some problems with images linked to a project, so I want to keep it clean.

How can I delete all images from a project?
I had a script that can delete unlinked images, but how do I unlink them all?
Combining this and this answers, one may get code like this:

    import bpy 

    for img in bpy.data.images:
        img.user_clear()


It will unlink all images in the .blend (one currently selected in the UV Image Editor will remain selected, but also will become unlinked, you can unlink one image by yourself or make improvement to the code). 

Then you will only need to delete unlinked images.

The final code might look like this (thanks for evilferber's comment):

import bpy 
for img in bpy.data.images: 
  img.user_clear() 
for img in bpy.data.images: 
  if not img.users: 
    bpy.data.images.remove(img)