PHP photo_gallery with Smarty