C'è un errore nella query che utilizzi per generare il recordset $rsFoto.