Fixing the thumbnail creation