At least 47 Palestinians have been injured - mostly by gunfire - when a crowd overwhelmed an aid hub in Gaza, according to a UN official.