Ho risolto la questione delle gif.
Occorre aggiungere all'inizio:
<%@ Import Namespace="System.Drawing.Imaging.ImageFormat"%>
e poi mettere:

' Set the contenttype
if thisformat.equals(system.drawing.imaging.imageform at.Gif) then
response.contenttype="image/gif"
else
response.contenttype="image/jpeg"
end if

Rimane la questione delle immagini presenti su altro server