I currently have this query
SELECT short_url,
type,
file_thumbnail,
file_embed,
media.id,
user,
media.file_u
You could use a union to get the previous and next rows:
SELECT
...
FROM info
INNER JOIN media
ON info.mid = media.id
WHERE media.id < '$id'
GROUP BY mid
ORDER BY media.id DESC
UNION ALL
SELECT
...
FROM info
INNER JOIN media
ON info.mid = media.id
WHERE media.id = '$id'
GROUP BY mid
ORDER BY media.id DESC
UNION ALL
SELECT
...
FROM info
INNER JOIN media
ON info.mid = media.id
WHERE media.id > '$id'
GROUP BY mid
ORDER BY media.id ASC
However, if your user will want to see the previous item or next item each time they navigate, then you're still going to hit the database to get the next item in whatever direction they're navigating.
I would recommend pulling a page at a time, and navigating through it on the front end instead.