thumbnail filesize can be bigger than the original image #17906
Description
For example, https://matrix.to/#/!bEWtlqtDwCLFIAKAcv:matrix.org/$RZTZTqR8xROKD6i_cnuPgW-NVmHHiTRIwie2b3poUaI?via=matrix.org&via=vector.modular.im&via=dataport.modular.im has a file size of 17226 for the image, but the file size of the thumbnail is 22985, which seems silly and defeats the purpose of having a thumbnail. We should detect if the generated thumbnail is bigger than the original image, and if so, we shouldn't upload the thumbnail, and should simply use the original image as the thumbnail instead