fixed overflow in pixel rendering