Trump on strong legal ground to stop caravan