Gallery image gets updated when rendering completes