Merge "Reland refactor of screenshot code on main thread." into main