Download link points to a new document. On that document you create a javascript-function which location-href's the user to the actual downloadable file.
Download.aspx:
<body onload="location.href='fileToDownload.zip'">
<p>Your download will start in a few seconds</p>
</body>
In your case of downloading an image you can add a download.aspx with the following code:
protected void Page_Load(object sender, EventArgs e)
{
var imageFilename = Request.QueryString["imgName"];
var path = Server.MapPath("/Images/" + imageFilename)
using (FileStream fs = File.OpenRead(path))
{
int length = (int)fs.Length;
byte[] buffer;
using (BinaryReader br = new BinaryReader(fs))
{
buffer = br.ReadBytes(length);
}
Response.Clear();
Response.Buffer = true;
Response.AddHeader("content-disposition", String.Format("attachment;filename={0}", Path.GetFileName(path)));
Response.ContentType = "image/jpeg";
Response.BinaryWrite(buffer);
}
}
<body önload="location.href='download.aspx?imgFile=nicepicture.jpg'">
<p>Your download will start in a few seconds</p>
</body>