SELECT ws.title AS title, DATE_FORMAT(ws.created, '%M %d, %Y') AS created, i.thumbnail AS thumbnail, i.alttag AS alt, u.url as url,
(SELECT count(im.id) FROM images im WHERE im.obj_id = ws.id and im.obj_type = 'ws' AND im.flag = 0) as image_count
FROM web_stories AS ws
LEFT JOIN images AS i ON i.obj_id = ws.id
LEFT JOIN urls_real AS u ON u.objId = ws.id
WHERE ((i.flag = '1') AND (i.obj_type = 'ws') AND (u.objType = 'ws'))
AND ws.private=0
AND ws.story_about='Salman Saeed'
ORDER BY ws.id DESC
LIMIT 5