moved getTreeFromRail out of plotTreeOnRail hopefully incorporate Giacomo's changes to the image comparison