Fix AppTray icon problems on OS X

OS X doesn't support GIF images as application/tray icons. If we try to
operate on these kind of icons we get a NullPointer exception.
Fix Safari CORS redirect