fix imageIndex increment