Fully rewritten from scratch.
Template function, shortcode, manual thumbnail dimensions - removed.
Code cleaned up.