Trouble when deleting images with duplicates
If an image with duplicates is removed, and these duplicates were created after the one which got removed (i.e. the imgid of the duplicates is bigger), then the xmp filenames of these images will change. In the best case they will be decreased by 1 so that the xmp file of the image with the biggest id will be on disk twice. In the worst case, some xmp files will be decreased, overwriting the sidecars of others. Not good. We either have to keep track of the version number of every image in the db so that it will never change. Or we could delete+recreate all the xmp files of affected images.