FC-2833: Fixes error while generating images or editing items with related images.

git-svn-id: https://farcry.jira.com/svn/FC/branches/p630@12994 8f7d33b6-1012-0410-9a5a-bb7ecce9c363