Hierarchical gallery

WordPress Posts (First level)

Yes, the posts feature can be used as a gallery. WordPress provides nice short code to show all the attached images in post. While adding galleries make sure they point to attachment page not to the real file.

When user clicks on any of image from the gallery they’ll get to the attachment page.

Attachment template (Second level)Codex

An “attachment” is a special post that holds information about files uploaded through the Media upload system.

You can use attachment template to show image as post and I guess, by little configuration you can enable comments for attachment posts too.