Fixing IMAGE_ID problem. Use image_name if it exists