Tens of thousands of mourners waving Palestinian flags , and photos of their leader greeted the military helicopter as it brought his flag-draped coffin from a funeral in Cairo .