Restrict size of image attachments
We can not process images of arbitrary size, because the device may lack the memory to load the entire image into it or because the maximum texture size is smaller than the image.
- don't read entire images in memory
- scale full screen images down to screen size to avoid exceeding max texture size
- add tests for MarkEnforcingInputStream
- tests for our own code that handles the various image types and edge cases
- limit our supported mime types to image/gif, image/jpeg and image/png
- limit the size of images that can be sent
Subtask of #1237.