Fix bug in Raster#getSubImage and add test.