Well.
You have a name like this
"image1.jpg".
You can use strrpos (with "r" for reverse...) to get the position of "."
Because strrpos counts from the end, we need to subtract to strlen:
$mpos=strrpos($filename,".");
$mpos=strlen($filename)-$mpos;
Now we can divide the name from extension:
$basename=substr($filename,0,$mpos);
And we can now echo this:
<?echo "<a href=\"$path/$basename.jpg\">Download Image</a> | href=\"$path/$basename.psd\">Download PSD </a>|"
?>
Maybe I'm wrong for a +1 or -1, but with some test you can easily debug it.