Added compressed image support to Image::GetSubimage() and fixed bugs in the function.