A couple of tips:
1. Set your ISO/aperture lower so that the fireworks aren't blown out or white, like in the first picture. They will have much richer colors.
2. You'll have to check your manual on how to do this, but you want to focus lock on infinity, so the fireworks aren't blurry.
Hope this helps, and have fun taking pictures!