median: give better error on out of bound axis