I think I understand what you're looking for.
Query #1
You want all galleries, along with a single image for each gallery. Since Django automatically allows you to access related objects you can accomplish this by simply retrieving all the galleries in your db.
select_related()
automatically "follows" foreign-key relationships when it executes the query, which means later use of foreign-key relationships won't require database queries.
#selects all galleries ordered from newest to oldest
galleries = Gallery.objects.order_by('-pub_date').select_related()
To get the first image from each gallery in your template, you would do this:
{% for gallery in galleries %}
{{ gallery.name }}
<img src="{{ gallery.image_set.all.0.image }}">
{% endfor %}
https://docs.djangoproject.com/en/dev/ref/models/querysets/
https://docs.djangoproject.com/en/dev/ref/models/querysets/#select-related
https://docs.djangoproject.com/en/dev/ref/templates/builtins/#for
Query #2
This actually works exactly the same as the previous query, but for only a single gallery.
gallery = Gallery.objects.get(id=gallery_id).select_related()
In your template:
{% for image in gallery.image_set.all %}
<img src="{{ image.image }}"><br>
{{ image.caption }}
{% endfor %}