Texture/VideoTexture: save last frame index

- saves the last index to avoid jumping if frames are successive
- fix some indentations