Depolarization effects in thin ferroelectric films