void Run()
            {
                Process.SetThreadPriority(ThreadPriority.Background);
                if (_context._adapter == null)
                {
                    _context.SendMessage(ConstantsCustomGallery.FETCH_STARTED);
                }

                File file;
                var  selectedImages = new List <long>();

                if (_context._images != null)
                {
                    for (int i = 0, l = _context._images.Count; i < l; i++)
                    {
                        var image = _context._images[i];
                        file = new File(image.Path);
                        if (file.Exists() && image.IsSelected)
                        {
                            selectedImages.Add(image.Id);
                        }
                    }
                }

                var cursor = _context.Application.ApplicationContext.ContentResolver.Query(
                    MediaStore.Images.Media.ExternalContentUri, _context._projection,
                    MediaStore.Images.Media.InterfaceConsts.BucketDisplayName + " =?", new string[] { _context._album },
                    MediaStore.Images.Media.InterfaceConsts.DateAdded);

                if (cursor == null)
                {
                    _context.SendMessage(ConstantsCustomGallery.ERROR);
                    return;
                }

                /*
                 * In case this runnable is executed to onChange calling loadImages,
                 * using countSelected variable can result in a race condition. To avoid that,
                 * tempCountSelected keeps track of number of selected images. On handling
                 * FETCH_COMPLETED message, countSelected is assigned value of tempCountSelected.
                 */
                int tempCountSelected = 0;
                var temp = new List <Image>(cursor.Count);

                if (cursor.MoveToLast())
                {
                    do
                    {
                        if (Thread.Interrupted())
                        {
                            return;
                        }

                        var id         = cursor.GetLong(cursor.GetColumnIndex(_context._projection[0]));
                        var name       = cursor.GetString(cursor.GetColumnIndex(_context._projection[1]));
                        var path       = cursor.GetString(cursor.GetColumnIndex(_context._projection[2]));
                        var isSelected = selectedImages.Contains(id);
                        if (isSelected)
                        {
                            tempCountSelected++;
                        }

                        file = null;
                        try
                        {
                            file = new File(path);
                        }
                        catch (Exception e)
                        {
                            Log.Debug("Exception : ", e.ToString());
                        }

                        if (file.Exists())
                        {
                            temp.Add(new Image(id, name, path, isSelected));
                        }
                    } while (cursor.MoveToPrevious());
                }

                cursor.Close();

                if (_context._images == null)
                {
                    _context._images = new List <Image>();
                }

                _context._images.Clear();
                _context._images.AddRange(temp);

                _context.SendMessage(ConstantsCustomGallery.FETCH_COMPLETED, tempCountSelected);
            }