fixed bug gpi array was in incorrect order when using shape option