Since 2.8, background images are tied to cameras (in 2.79 these were
tied to a View3D I think).
Code in BKE_library_id_can_use_idtype wasnt taking this relation
between Camera and Image into account, thus leading to ID deletion/
unlinking not working properly -- in particular libblock_remap_data
not doing its thing (and leaving the camera as a user of the image),
then things went downhill from there...
Now make the "Camera-can-use-an-Image" relation clear in
BKE_library_id_can_use_idtype.