check for jpeg/gif/png file extension using regular expressions