The height distribution of flare hard X-rays in thick and thin target models