Can someone help me with a javascript code to validate an image URL?

I want to validate the following:

1. the URL must start with http://
2. the URL must end with .gif, .jpg, .jpeg or .png

I'm I leaving out something?