add option to sort sprite using indices