Ensured that preview thumbnails are set correctly

Some images contain embedded thumbnails. However, when those thumbnails are smaller than 400x400, we didn't create the default ones. This is now fixed.