This question has been answered by multiple community members. See the first response.

[[!migxLoopCollection?
&packageName=`migxgallery`
&classname=`migxGallery`
&sortConfig=`[{"sortby":"title","sortdir":"ASC"}]`
&where=`{"resource_id":"[[*id]]","published":"1"}`
&tpl=`@CODE:[[$migxGalleryThumbs]]`
]]
<a href="[[+image]]"><div class="thumbnail_block"> <img class="thumbnail_img" src="[[!pthumb? &input=`[[+image]]` &useResizer=`1` &options=`w=160 &h=140 &zc=1 &q=50`]]" /> <div class="thumbnail_title">[[+title]]</div> </div></a>
[[*thumbnailImage:phpthumbof=`w=160&h=140&zc=1`]]
<img src="" />
&tpl=`migxGalleryThumbs`
The only question is that I still don't have any real file copies in the original gallery directory something like "image001_thumb" or whatever. Is it suppose to keep the thumbnails in cache and what happens when the gallery has many images, does the cache gets overloaded and etc? I mean, what is the workflow for pThumb here?