At block 656, the system may retrieve the lengths of at least some of the data corresponding to the respective image qualities included in image data of the referenced image (such as the length of the thumbnail data). As previously noted, the data lengths may not correspond precisely to the chunk lengths of the E2EE data stream, and so the system may use this information to determine how many chunks are needed in order to obtain the data corresponding to each respective image quality.
At block 658, the system may determine if autodownloading of thumbnails is enabled. If not, processing proceeds to block 660 and the system awaits a request to display the image message before downloading the thumbnail data. Such a request may be in the form of a request to load a thread containing the image message, or to scroll to a point in the thread at which the image can be viewed. Alternatively, if autodownloading is enabled, then processing may proceed directly to block 662.
At block 662, the system retrieves the image data corresponding to the thumbnail from the blob store. This may involve initiating a data stream with the blob store in order to retrieve the image data corresponding to the reference in the original image message. The system may download one or more chunks corresponding to the thumbnail.