If your Sims 4 gallery is not working then leave the game and shift the mods folder to your desktop. Delete localthumbcache package file to aid troubleshoot from Documents/Sims 4 folder. Restart the game and try opening the gallery.