That's because the image is 256x170 which is smaller than your 320x240 image resize.
in dothumb()
Replace this:
Code:
if(($img_info[0] <= 80) and ($img_info[1] <= 60)) {
$code = "<a href=\"$code\" target=\"_blank\"><img src=\"$code\"></a>";
}
with this:
Code:
if(($img_info[0] <= 80) and ($img_info[1] <= 60)) {
$code = "<a href=\"$code\" target=\"_blank\" border=\"0\"><img src=\"$code\"></a>";
}
Excpet that instead of 80 and 60 you would be using 320 and 240 in the if statement.