fix dimensions not divisible by 2