Custom template should be archive-gallery.php
instead of archive-posttype.php
It's archive-$posttype.php
where $posttype
is the custom post type slug.
WordPress first looks for archive-$posttype.php
and if it's not available then chooses archive.php
Same for the custom taxonomies also , the flow is:
taxonomy-$taxonomy-$term.php --> taxonomy-$taxonomy.php --> taxonomy.php --> archive.php