More robust and Pythonic way would be to just do `imageId=api_node.get('image', {}).get('id', None)`