how can i download the images with no extension on linux

view story

http://stackoverflow.com – In my python script i am getting the links of the images from the webpage. But few of the images links are like this image.php?u=155594&dateline=1182409179 The terminal says like this HTTP request sent, awaiting response... 200 OK Length: 4159 (4.1K) [image/png] But image gets saved like image.php?blabla is there any to save it in proper format with extension (HowTos)