How can I unlink all images from a project?
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)