EZP-21213: Fixed a bug in Image Legacy Gateway