You can train for a large set and pad shorter ones (that’s the typical approach when working with sequences)
Another idea is to compute N features for N images and then doing an average (which is somehow a good option)