few fixes in ImageBitmap
better dealing with resamplng
better base calculation