Fix a reference not found in a version document

Hi,

When I want find a version by version name, I get an error if the version have a reference to a removed document.

The process:

1. I create an image (or another document)
2. I create a document with a reference to the image created before
3. I create a version of the document (1.0)
4. I remove the reference to the image
5. I create a new version of the document without the reference (1.1)
6. I remove the image
7. I want find the version 1.0 of the document and I get an error `ItemNotFoundException` with an uuid. I found this uuid is the uuid of the removed image.

This fix allow us to get a version without the reference if it is removed. I need it for my professional project.

Thanks