Fix EZP-23477: exception when trashing empty image