C is great for low level coding. You are talking about a high level task and could switch to a higher level language to make your life more productive.
view an image with Python using the PySide GUI toolkit
PySide is the official LGPL-licensed version of PyQT (QT)
Python and PySide are available for Windows, Linux and Apple OS X.
If you have Windows, download and execute the Windows self-extracting
installers in this order.
For Python33 (get the 32 bit version):
PySide-1.1.2.win32-py3.3.exe (based on QT483)
from PySide.QtCore import *
from PySide.QtGui import *
app = QApplication()
# create the window/frame
win = QWidget()
# set location and size
win.setGeometry(100, 50, 500, 688)
# set the title
win.setWindowTitle("PySide Image Viewer")
# get an imagefile you have in the working folder
# or give full file path
fname = "cogtrain-500x688.jpg"
# load the picture in a form PySide can process
image = QPixmap(fname)
# use a label to display the image in
label = QLabel(win)