Create gallery-latest.php

Final version of gallery.php script optimized for better performance