Amazon shares rally after strong second quarter and guidance