Only need to emptySelection() when we are deselecting a gallery and not selecting another.

Fixes issue where the cursor would not be placed in the correct location on FF.