refactor to speedup by adding pause slideshow while opening dialog.