Flip the image in read_pixels and test read_pixels

- In read_pixels, the result image is upside-down. Flip the image using `[::-1]`.
- Unit test for read_pixels: Draw a white square on top left, check sums of pixels in corners to compare result.