Update gallery.php

Change readdir by scandir to have the order option