Fix EZP-22913: prevent exponential growth in number of queries when removing image alias attributes
Merge pull request #982 from joaoinacio/EZP-22913_removealiases_queries

Fix EZP-22913: prevent exponential query growth when removing image alias