switched to unsigned bytes, and fixed gif check
implemented drawRoundRect as a path, probably doesn't handle bitmapfills