Merge pull request #805 from Mossop/bug842702

Fix Bug 842702: Don't attempt to use undefined or null as valid images for context-menu items. r=@erikvold(cherry picked from commit a434925f8210365b896b11d0c8dde451093a8e24)