Fixeed bug where connection gets dropped when entering photo chooser