Merge pull request #10136 from davidflanagan/bug875641

Bug 875641: update MediaDB and Gallery to handled SD card removal and sharing when there is also internal storage r=dhylands(cherry picked from commit b51af7558dd9e39da536ad77e975f3a3ab866d36)
Merge pull request #10137 from davidflanagan/bug875641-v1-train

Merge pull request #10136 from davidflanagan/bug875641