Fixed a bug that could cause invalid memory to be accessed

The bug could happen when transparency is removed from an image.
Also fixed a semi-related BMP error handling logic bug.
Fixes issue #21
static size_t rle4_get_best_unc_split(size_t n)
{
	if(n<=255) return n;

	if(n==257 || n==510 || n==765) return 255;

	return 252;
}

static size_t rle4_get_best_unc_split(size_t n)
{
	if(n<=255) return n;

	if(n==257 || n==510 || n==765) return 255;

	return 252;
}
