EZP-21735: fixed using non existent variable
EZP-21324: image files can be removed by mistake

Since copies of archived versions aren't processed by eZDatatype::onPublish,
they still reference the same images than the original.

The removeAliases() method didn't take this into account, and could
delete images that were actually used by the original content.

This patch prevents the method from deleting images that don't have
an entry in ezimagefile.
EZP-21324: Added tests

Taken from https://github.com/ezsystems/ezpublish-legacy/pull/792
Merge pull request #824 from ezsystems/fix-EZP-21735-relation-not-showing

EZP-21735: fixed using undefined variable
Merge pull request #825 from ezsystems/fix/EZP-21324-removing_archive_copy_removes_file

EZP-21324: image files can be removed by mistake
Fix EZP-21883: Regression from ezp-21357 with images with utf-8 names
EZP-21913: Fixed globals for scripts:

- updateniceurls.php
- runcronjobs.php
- ezasynchronouspublisher.php
- ezsubtreecopy.php
Doc EZP-21913: Add bc note on global use in bin/php scripts
Fix EZP-21914: reset ezcDb link from ezasynchronouspublishing.php
Merge pull request #832 from ezsystems/fix/EZP-21914-asyncpublishing_new_stack_db_link

Fix EZP-21914: reset ezcDb link from ezasynchronouspublishing.php
Merge pull request #831 from ezsystems/fix_EZP-21913_5.2_release

EZP-21913: Fixed globals for critical scripts