im want to download a jpg file but its not working plz check and response...........ASAP

<?
$filename = $_GET['imgname'];
$filepath = $_GET['img'];
$sid = $_GET['sid'];

$size = filesize($filepath);
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
header("Content-Type: image/jpeg");
header("Content-Disposition: attachment; filename=".$filename);
header("Content-Transfer-Encoding: binary\n\n");
header("Content-Length: ".$size);
?>

in $filepath i have the value "prodimages/imagename.jpg"
where prodimage is a folder in my site where the images r placed and the file with the download script is in the root of my site same as the prodimages folder.

im getting the size to but its not downloading instead image it downloads a html file

plz advise and correct...