Loading images from .php

Hi!!!

I have to load images into the flash applet by giving the tag

<img src=http://www.foo.com/bar.php?id=1>

In the php file i have specified the MIME type as image/jpeg. The image is getting loaded in the internet browser. But when i give the same url in a img src tag of a textarea by enablling html, somehow it doesnt work. But I am able to load the image if the src is like

<img src=http://www.foo.com/bar.jpg>

Why am I facing this problem? Does flash decides the file type by its extension and not by its MIME type.

I am really stuck in this…!! Plz help

TIA,
deeps