added option to have thumbnails at top or bottom
Cleaned up plugin source a bit