SELECT `plogger_pictures`.`id`,`path`,`caption`, COUNT(`comment`) AS `num_comments` FROM `plogger_pictures` LEFT JOIN `plogger_comments` ON `plogger_pictures`.`id`=`plogger_comments`.`parent_id` WHERE `plogger_pictures`.`parent_album` = 13 GROUP BY `plogger_pictures`.`id` ORDER BY `date_submitted` DESC,`plogger_pictures`.`id` DESC LIMIT 0,10