How to Clean a Gallery on Xiaomi: From Duplicates to Hidden Files

The gallery on Xiaomi smartphones is one of the most voracious applications: it takes up gigabytes of memory not only in photos, but also in cache, thumbnails, duplicates and utility files. Even after manually deleting photos, the free space often melts at an alarming rate. Why?

In this article, we will discuss 5 proven ways to clean a gallery, from basic (delete unnecessary photos) to advanced (clear cache through ADB and hidden folders.thumbnails). Particular attention will be paid to models with MIUI 14/15, where the logic of file storage has changed. You will also learn how to avoid typical errors, such as the accidental deletion of screenshots or files from Telegram, which the gallery mistakenly indexes as photos.

Warning: Before mass deletion of files, make sure to check if they are not synced to the cloud. Xiaomi may have its default โ€œAuthorizationโ€ feature enabled (Settings โ†’ Xiaomi Account โ†’ Mi Cloud โ†’ Gallery) that deletes local copies after uploading to the cloud. If you clean the gallery without a backup, it will be impossible to restore images.

To start, identify what exactly is taking up space. Go to Settings โ†’ Memory โ†’ Memory Analysis and select Media Files. Here you will see the distribution by category: Photos, Videos, Screenshots, Downloads and Others. Pay attention to the item โ€œCache Galleryโ€ โ€“ it can reach 1-3 GB even if you empty gallery.

1. manually remove unnecessary photos and videos

The most obvious, but often ignored, way is by hand sorting, and many users delete only the latest images, forgetting about old folders, duplicates, and screenshots.

  • ๐Ÿ“ Camera folder -- it's where all the photos taken on the front and the front cameras are stored, and often there are selfies with the same angle or failed shots.
  • ๐Ÿ“ฑ Screenshots folder โ€“ screenshots take up to 500 MB-1 GB, especially if you actively share information in instant messengers.
  • ๐Ÿ”„ Edited folder โ€“ edited versions of the photo are saved here (even if the original is deleted).
  • ๐Ÿ“ฅ Downloads folder โ€“ the gallery indexes all uploaded pictures, including memes from Telegram or Telegram VK.

To speed up the process, use the selection mode in the gallery:

  1. Open the Gallery app.
  2. Click and hold any photo, then select the others.
  3. In the top panel, tap on ๐Ÿ—‘๏ธ ยซDelete" (or โ‹ฎ โ†’ Delete).
  4. Confirm the action by pressing โ€œOKโ€.

Important! Deleted files go to the Recycle Bin (Gallery โ†’ Albums โ†’ Recycle Bin), where they are stored for 30 days. To make room right away, clean the Recycle Bin manually: highlight all files and click Delete Forever.

๐Ÿ“Š How often do you clean up a gallery on Xiaomi?
Once a week.
Once a month
Only when memory ends
Never cleaned.

2. Search and remove duplicate photos

Duplicates are one of the main causes of memory overload, and they occur when:

  • ๐Ÿ”„ Transfer photos between devices (for example, via ShareMe or Bluetooth).
  • ๐Ÿ“ฑ Automatic backup in Google Photos and Mi Cloud.
  • ๐ŸŽจ Photo editing (original) + edited).

MIUI 14/15 has a built-in tool for finding duplicates:

  1. Open the gallery. โ†’ Albums. โ†’ Duplicate (or) โ‹ฎ โ†’ Management โ†’ Duplicate).
  2. The app will automatically group the same photos. Select the unnecessary copies.
  3. Click "Delete" and confirm the action.

If your version of MIUI does not have this feature, use third-party apps:

  • ๐Ÿ› ๏ธ Files by Google โ€“ in the โ€œCleaningโ€ section there is a tool โ€œDuplicatesยป.
  • ๐Ÿ” Duplicate Files Fixer โ€“ search for duplicates not only photos, but also videos.

๐Ÿ’ก

Before removing duplicates, sort the photo by date (Gallery) โ†’ โ‹ฎ โ†’ Sorting โ†’ It's easier to tell which copy is newer and better in quality.

Note: Some apps (such as WhatsApp or Viber) create thumbnails of chats in the Pictures folder, which may appear as duplicates, but it is not recommended to delete them, this will lead to errors in the messengers.

Gallery cache and thumbnail folder (.thumbnails) can take anywhere from 500MB to 2-3GB, even if the gallery itself has few photos, which are needed to quickly download previews, but over time they accumulate and become useless.

Cleaning methods:

  • ๐Ÿงน Through the App Settings: Go to Settings โ†’ Annexes โ†’ App management. Find the gallery and tap it. Select "Memoryยป โ†’ ยซClear the cacheยป.
  • ๐Ÿ—ƒ๏ธ Delete the.thumbnails folder manually: Connect your phone to your PC or use a file manager (such as Mi File Manager (/storage/emulated/0/). Enable the display of hidden files (โ‹ฎ โ†’ Delete the.thumbnails and DCIM/.thumbnails.

Once the cache is cleared, the gallery will be slower when it first opens the albums โ€” it will take time to regenerate the thumbnails. That's normal and requires no additional action.

Check the space in the memory.

Create a backup of important photos

Close all applications that use the gallery (Viber, Telegram, etc.)

Restart your phone after cleaning.-->

4. Delete hidden and service files

DCIM, Pictures and Downloads folders often hide files that don't appear in the gallery but take up space.

  • ๐Ÿ“Œ Files with the.nomedia extension block the display of folders in the gallery, but they can weigh tens of megabytes.
  • ๐ŸŽฅ Video cache from TikTok, Instagram or YouTube โ€“ stored in the /Android/data/.
  • ๐Ÿ“‚ Folders from remote applications (for example, com.whatsapp or com.viber.voip).

To find and remove them:

  1. Use a file manager with access to root folders (such as Solid Explorer or FX File Manager).
  2. Turn on the hidden files and go to /storage/emulated/0/.
  3. Look for folders with names:.cache,.temp,.backup Android/data/ (here is the app cache) tencent/MicroMsg/ (weChat cache)

Don't touch it.

com.xiaomi.gallery

โš ๏ธ Attention: Do not delete folders Android/obb/ โ€” This is where game data is stored, for example, PUBG Deleting them will cause game disruptions.

Type of fileLocation.Can I remove it?
Miniatures (.thumbnails)/DCIM/.thumbnails, /.thumbnailsYes (restore automatically)
Cash Google Photo/Android/data/com.google.android.apps.photos/Yes (but the sync settings will reset)
.nomedia filesAny media folder.Yes (but the folder will be visible in the gallery again)
Cash messengers/Android/data/com.whatsapp/, /tencent/MicroMsg/Partially (remove only the cache folders)

If standard methods didnโ€™t help and the gallery still takes gigabytes of memory, try resetting the appโ€™s settings or cleaning through ADB. These methods are suitable for power users.

Method 1: Reset the gallery to factory settings

  1. Go to Settings โ†’ Applications โ†’ Application Management โ†’ Gallery.
  2. Click on โ€œStorageโ€ โ†’ โ€œClear Dataโ€.
  3. Confirm the action. This will delete all gallery settings, but it won't affect the photos themselves.

Method 2: Cleaning through ADB (for advanced)

If the gallery is โ€œglutchingโ€ and does not display the photo correctly, follow the commands:

adb shell pm clear com.miui.gallery


adb shell rm -rf /storage/emulated/0/DCIM/.thumbnails




adb shell rm -rf /storage/emulated/0/.thumbnails

โš ๏ธ Attention: Teams ADB require the debugging enabled USB (Settings โ†’ The phone. โ†’ Version. MIUI โ†’ 7 times tap the build number, then Settings โ†’ Additionally. โ†’ For developers โ†’ Debugging by USB). Improper use can lead to system failures.

What if the gallery does not open after cleaning?
If after resetting or deleting the cache, the gallery gives an error, follow the following steps: 1. Reboot the phone. 2. Clean the cache again through Settings โ†’ Annexes โ†’ gallery โ†’ Memory. 3. If the problem persists, update the Gallery app through Play Market (if available there) or reinstall it through Play Market. ADB: adb shell pm uninstall -k --user 0 com.miui.gallery adb shell cmd package install-existing com.miui.gallery 4. In extreme cases, back up the photo and reset the phone to factory settings (Settings) โ†’ The phone. โ†’ Resetting settings).

6. Cleaning automation: MIUI settings and third-party utilities

To avoid manually cleaning the gallery, set up automatic optimization:

  • โ˜๏ธ Setting up Mi Cloud: Go to Settings โ†’ Xiaomi account โ†’ Mi Cloud โ†’ Gallery. Turn off Autoreserve if you don't want your photos deleted from your phone after uploading to the cloud. Turn on Storage Optimization, which will only save thumbnails on your phone, and the originals will be downloaded on request.

Third-party utilities for automatic cleaning:

  • ๐Ÿ”„ Automate โ€“ lets you create a rule for weekly cache cleaning.

๐Ÿ’ก

Regularly cleaning the gallery (once every 1-2 weeks) prevents the accumulation of cache and duplicates. Set up notifications in MIUI Optimizer or use the Memory Cleanup widget** on the home screen.

Frequent Mistakes and How to Avoid Them

When cleaning the gallery, users often face problems:

  • ๐Ÿšซ Delete files from Telegram or WhatsApp: The gallery indexes media from instant messengers. If you delete them through the gallery, they will disappear in chats. To avoid this, open the messenger settings and turn off "Save in the gallery" (Settings). โ†’ Memory and data โ†’ Keeping Media on Telegram).