What are the advantages and disadvantages of using separate tables for categories and images in a PHP database for a postcard system?

When designing a postcard system in PHP, using separate tables for categories and images allows for better organization and flexibility in managing the data. However, this approach can also lead to more complex queries and potential performance issues when retrieving and displaying the data.

// Create a table for categories
CREATE TABLE categories (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(50) NOT NULL
);

// Create a table for images
CREATE TABLE images (
    id INT AUTO_INCREMENT PRIMARY KEY,
    category_id INT,
    title VARCHAR(100) NOT NULL,
    file_path VARCHAR(255) NOT NULL,
    FOREIGN KEY (category_id) REFERENCES categories(id)
);