Fix for #154

Fix for #154 "Galleries: Thumbnails of images added from folder aren't displayed"
https://github.com/aheinze/cockpit/issues/105
Fix for #105 (2)

with previous commit thumbnails are displayed only when variable site2media is empty (for user in admin group for example). now it works in both cases.
Fix for #105 (3)

with "Fix for #105 (2)" commit only first import from folder works if site2media is not empty. now i sure thumbnails displayed in all cases)
Merge pull request #119 from kinolaev/patch-2

Fix for #105