Correct bug when system gallery is deleted