private bool LoadImage() { try { // Get the user IUser user = instagram.GetUserById(userLoaded.Id); if (user == null) { return(false); } string url = user.ProfilePictureUrl; Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Render, new Action(() => { ProfileImage.Fill = new ImageBrush() { ImageSource = url == null ? null : PathUtilities.GetImageSourceFromUri(url) }; })); SetRandomBackground(); return(true); } catch (Exception) { return(false); } }