// Selection of image data in the multimedia table
Select substring(SPATH from 6 for 200) Path ,sorgfilename dest,
sgroup FROM MULTIMEDIA join groups on wrefid = wgroupid where WREFID = <@WGROUPID@> and STYPE = 'GROUP' and (SPATH like 'link:%' or SPATH like 'file:%') 
and (SGROUP = 'category_thumb_image' or SGROUP = 'category_full_image')
