[MERGE] Fix viewer rotation and get next index

Signed-off-by: David Goulet <dgoulet@efficios.com>