Your output was starting at the tenth file name.
You need to change three lines:
$req_pages = round($total_files/$number_to_display);
to
$req_pages = ceil($total_files/$number_to_display);
<a href="?start=<? echo $total_files-$number_to_display; ?>">Last</a> |
to
<a href="?start=<? echo ($x-1)*$number_to_display; ?>">Last</a> |
(Solves a pagination issues)
and
$vf = $z+($start+$number_to_display);
to
$vf = $z+$start;