correct the following python script:
import tkinter as tk
from PIL import Image, ImageTk

# Create the main window
root = tk.Tk()
root.title("JPG, PNG Image Viewer")

# Create the file dialog
def open_file():
    file_path = filedialog.askopenfilename()
    if file_path:
        img_path, file_ext = os.path.splitext(file_path)
        img = Image.open(file_path)
        img_tk = ImageTk.PhotoImage(img)
        img_label = tk.Label(root, image=img_tk, borderwidth=5)
        img_label.pack()
        file_name_label = tk.Label(root, text=file_path)
        file_name_label.pack()
        root.title(file_path)

# Create the image zoom button
def zoom_in():
    img_tk.zoom()

def zoom_out():
    img_tk.zoom(-1)

# Create the save button
def save_image():
    img.save(file_path)

# Create the file name label
file_path = ""
def update_file_name():
    file_name_label.config(text=file_path)

# Load the initial image
img_path = ".\images\image.jpg" # replace with path to your image
png_path = ".\images\image.png" # replace with path to your PNG image

img = Image.open(img_path)
img_tk = ImageTk.PhotoImage(img)
img_label = tk.Label(root, image=img_tk, borderwidth=5)
img_label.pack()
file_name_label = tk.Label(root, text=file_path)
file_name_label.pack()
root.title(file_path)

# Create the open button
open_button = tk.Button(root, text="Open Image", command=open_file)
open_button.pack()

# Create

# Run the GUI loop
root.mainloop()