"select WHATEVER from TABLE where img_id in ($prev_id, $img_id, $next_id)"