front: Cancel background tasks whenever GalleryActivity stops.