fix index to reference right images