Even your vague ideas about the design of the gallery are not good enough to start doing this project.
For example, fixed number of images on row is really bad, it would assume fixed size of a browser window which is ridiculous — this is not what happens in real life on the client side. Some (many) use the mobile devices. Any provisions of thumbnail? Without those you cannot make a gallery convenient, not even close. How about different viewing options? Smaller size, actual size, "real pixel"? Zoom? (This can be considered as too advanced.)
Now, you can find tons of projects to use for samples or just to learn some techniques:
or may be