Fixed EZP-21324: Images for original object lost when editing copies

Issue: https://jira.ez.no/browse/EZP-21324

## Problem 1 (the initially reported one)
When an object (containing a non empty ezimage attribute) and all its versions are removed, the ezimage attribute files are removed without any checks whether those files are still referenced in another copy of that object.

## Problem 2
When a copy of an object (containing a non empty ezimage attribute) is made with all the versions, the `ezimagefile` table only gets the record of the published version, missing the entries for the previous versions.

## Solution
Only files used once are retrieved (thanks to an SQL self-join) and removed.