[Olena-patches] milena r1459: Fix bug for tree_to_image