Creating a gallery with thumbnails using php with classes