So you can't do a direct 1-to-1 mapping of pixels to bytes, because Twitter re-compresses the image. You cannot rely on the binary representation of the image to make that work.
However, there are plenty of other, less funny, options, like QR codes or High Capacity Colour Barcodes.