mot-encoder: only close directory if slideshow is active