I came across this by having the Customize page open adding new header images over a long period of time. Logging out and back in again allowed me to continue uploading. It would be nice if the error were a bit more informative or just automatically logged you out at that point.