Pygame telling me that a image isn’t a file object

I am making a Shape Defense game where you fire bullets at enemies and evolve from triangle, to square, to pentagon, and beyond. I am trying to make the game over image show. However, when an enemy and the player collide, pygame gives me an error that says TypeError: not a file object. How can I make the game over image show?

This is my current code:

import pygame
import random
from pygame.locals import *
from pygame.color import THECOLORS

screen = pygame.display.set_mode((800, 600))
pygame.display.set_caption("Shape Defense")


class Sprite(pygame.sprite.Sprite):
    """Base class for all sprites"""

    def __init__(self, window, x, y, image, size=None):
        pygame.sprite.Sprite.__init__(self)

        self.screen = window
        self.x = x
        self.y = y
        self.image = pygame.image.load(image)

        if size is not None:
            self.image = pygame.transform.scale(self.image, size)

        self.rect = self.image.get_rect()
        self.rect.center = (self.x, self.y)

    def update(self):
        self.rect.center = (self.x, self.y)
        self.screen.blit(self.image, self.rect)


class Polygon(Sprite):
    """Is it going to be a triangle, a square, a pentagon, or something else?"""

    def __init__(self, sides, window, x, y, size=None):
        self.window = window
        self.x = x
        self.y = y

        if sides == 3:  # Is it a triangle?
            self.image = "C:/Users/linpang2018/Desktop/TRASHY JUNK/PICTURES/FOR PYGAME GAMES/triangle.png"

        Sprite.__init__(self, self.window, self.x, self.y, self.image, size)

    def check_for_movement(self, move_amount=1):
        """Let's get moving!"""

        key = pygame.key.get_pressed()

        if key[K_w]:
            self.y -= move_amount
        if key[K_s]:
            self.y += move_amount
        if key[K_a]:
            self.x -= move_amount
        if key[K_d]:
            self.x += move_amount


class Bullet(Polygon):
    """
    I guess I need to change my mind about thinking no shape
    games have bullets
    """

    def __init__(self, sides, window, x, y, size=None):
        self.sides = sides
        self.screen = window
        self.x = x
        self.y = y

        Polygon.__init__(self, self.sides, self.screen, self.x, self.y, size)

    def update(self):
        """Bombs away!"""

        self.y -= 10
        self.rect.center = (self.x, self.y)

        if self.y < 0:
            self.kill()


class Enemy(Polygon):
    """This game even has enemies?!"""

    def __init__(self, sides, window, x, y, size=None):
        self.sides = sides
        self.screen = window
        self.x = x
        self.y = y

        Polygon.__init__(self, self.sides, self.screen, self.x, self.y, size)

    def update(self):
        """Prepare yourself! A heavy attack is incoming! -the enemies"""

        self.y += 4
        self.rect.center = (self.x, self.y)

        if self.y > 650:
            self.kill()


class Image(Sprite):
    """Base class for all buttons and images that cover the whole screen"""

    def __init__(self, window, x, y, image, size=None):
        self.window = window
        self.x = x
        self.y = y
        self.image = pygame.image.load(image)

        Sprite.__init__(self, self.window, self.x, self.y, self.image, size)


bullet_group = pygame.sprite.Group()
enemy_group = pygame.sprite.Group()

player = Polygon(3, screen, 400, 400, size=(285, 200))
collided = False

enemy_interval = 2000
enemy_event = USEREVENT + 1
pygame.time.set_timer(enemy_event, enemy_interval)

clock = pygame.time.Clock()
running = True

while running:
    """Event loop"""
    for event in pygame.event.get():
        if event.type == QUIT:
            running = False

        """These lines creates a bullet object when the player clicks the screen"""
        if event.type == MOUSEBUTTONDOWN:
            bullet_group.add(Bullet(3, screen, player.x + 4, player.y - 15, size=(170, 100)))
        if event.type == enemy_event:
            enemy_group.add(Enemy(3, screen, random.randint(0, 900), 50, size=(230, 160)))

    screen.fill(THECOLORS["skyblue"])

    """Updates the player position and drawing the player"""
    player.update()
    player.check_for_movement(9)

    """Allows the bullets to appear and fire towards the top of the screen"""
    bullet_group.draw(screen)
    bullet_group.update()

    """
    Updates the enemy sprite(s) and allows the enemy to fly 
    toward the bottem of the screen
    """
    enemy_group.draw(screen)
    enemy_group.update()

    for i in enemy_group:
        if pygame.sprite.spritecollide(i, bullet_group, True):
            i.kill()

    if pygame.sprite.spritecollide(player, enemy_group, True):
        collided = True

    if collided:
        game_over_bg = Image(screen, 0, 0, "C:/Users/linpang2018/Desktop/TRASHY JUNK/PICTURES/FOR PYGAME GAMES/game_over.png")
        screen.blit(game_over_bg.image, game_over_bg.rect)

    pygame.display.update()
    clock.tick(40)

Answer

The image is loaded in your Sprite class:

class Sprite(pygame.sprite.Sprite):
   """Base class for all sprites"""

   def __init__(self, window, x, y, image, size=None):
       # [...]

       self.image = pygame.image.load(image)

There for you have to pass the filename to the class Sprite:

class Image(Sprite):
    """Base class for all buttons and images that cover the whole screen"""

    def __init__(self, window, x, y, image, size=None):
        self.window = window
        self.x = x
        self.y = y
       
        # self.image = pygame.image.load(image) <--- DELETE
        
        filename = image

        Sprite.__init__(self, self.window, self.x, self.y, filename, size)