May be using this query you don't get any result or empty result. You need to use OR
instead of AND
in your query like below.
$query = mysql_query("SELECT image_id FROM list WHERE (style_id = 24 AND style_value = 'red') OR (style_id = 25 AND style_value = 'big') OR (style_id = 27 AND style_value = 'round');
Try out this query.