Dismiss gallery on tap if no navigation controller
Example without navigation controller