It may sound odd, but use a pair of vise grips below the nail heads then use your pry bar under the vise grips. make sure your vise grips are gripped tightly. i have done this on many pallets. otherwise the heads like to pop off, then they can be almost impossible to remove.