I've already inputted the image in a .ui file
I don't think you want to put pixmap images into the UI file. UI files created using Qt Designer are generally used for parts of the user interface that do not change. About the only time you would use an image would be if it was part of a QLabel background or an icon.

Instead, you want to add your images as resources in a Qt resource file (.qrc). The qrc file is compiled into your program as data, so you do not need the original image files at run time. You will load the images from the resource file. Read about qrc files in the Qt documentation.

In the Qt Animated Tiles example, the images for the tiles are stored in the qrc file.