Enable adding a photo directly to a gallery, and fixed thumbnail refreshing issues