When using [[image:filename.jpg|opts|caption]] I was getting an sql error. no such field f.nid...

Line 58 had a left join on {files} nid = {node} nid. ... files has no such field. Added the join on the image table which has the keys nid<->fid (sigh, not exactly normalized) and presto. images work.

$image = db_fetch_object(db_query("SELECT n.nid, n.title, f.filename, f.filepath FROM {node} n LEFT JOIN image im ON im.nid = n.nid LEFT JOIN {files} f ON f.fid = im.fid WHERE n.status = 1 AND n.type = 'image' AND LOWER(n.title) = LOWER('%s') LIMIT 1", $src));