The pictures of Hamas dragging the bodies of alleged Israeli collaborators through the streets of Gaza were all over the internet a few days ago. The problem -- the bodies weren't those of Israelis collaborators but of Al Qaeda operatives whom Hamas had killed due to rivalry and tribal issues.
To understand this we must keep in mind that although Al Qaeda and Hamas frequently fight for the same ends, they do not always fight for the same reasons.
Hamas is Muslim Brotherhood, pure and simple, while Al Qaeda is Muslim Brotherhood "without the political angle." This difference allows Hamas to see Al Qaeda in the same light they'd see any other rivals under the right conditions.
This also means that if Al Qaeda operatives are too successful on Hamas' turf, their success may well spell their own doom, as it apparently did for certain Al Qaeda operatives heretofore described as Israeli collaborators.