Fixes an issue where the gallery debounce was happening before gallery was navigated to.
Fixes issue with resizing closing the dialog.