it doesnt sound right.
first, the THUMB_DIR is relative to SOURCE_DIR, that means, that the link created by combiing those two variables.
so, u can not use absolute path to THUMB_DIR.
if u dont have any thumbnails that are located on remote server (not phisicaly uploaded to your server, but just used link to it), then u can just delete the remote "detector":
Replace:
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
with:
$thumb_src = SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
P.S.
define('THUMB_DIR', 'data/thumbnails'); is correct dont change it, leave it as it is.