Image Store Hearts

WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ASC ) AS im LEFT JOIN wp_postmeta AS pm ON pm.post_id = im.ID LEF' at line 4]
SELECT SQL_CALC_FOUND_ROWS im.ID, im.post_title, p.comment_status, pm.meta_value meta, im.post_excerpt, im.post_parent, im.post_type, p.post_author FROM ( SELECT * FROM wp_posts ORDER BY ASC ) AS im LEFT JOIN wp_postmeta AS pm ON pm.post_id = im.ID LEFT JOIN wp_posts AS p ON p.ID = im.post_parent WHERE im.post_type = 'ims_image' AND pm.meta_key = '_wp_attachment_metadata' AND im.post_status = 'publish' AND p.post_status = 'publish' AND im.post_parent IN ( SELECT ID FROM wp_posts WHERE 0 = 0 AND post_type = 'ims_gallery' AND post_status = 'publish' AND post_password = '' ) GROUP BY im.post_parent ORDER BY p.post_date DESC, p.post_date DESC