Safer thumbnails construction