made map rebinning more robust (take any size)