Short answer: There is a buffer that can store up to 256 images.
When connectivity is unreliable, the device stores up to 256 images in its internal buffer. Once connectivity is restored, the images are uploaded in the order they were acquired. If the buffer reaches capacity, the device overwrites the oldest images first.