refactor rewinding code and try to sync with thumbnails