I'm not very good with debugging yet, so all I can give is the valgrind output :/
~ $ make
COMPILING build/texture.o
COMPILING build/loader.o
COMPILING build/viewport.o
COMPILING build/main.o
COMPILING build/util.o
COMPILING build/navigator.o
~ $ ./imv ~/pictures/img_0.jpg
Segmentation fault
~ $ valgrind ./imv ~/pictures/img_0.jpg
==22726== Memcheck, a memory error detector
==22726== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==22726== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==22726== Command: ./imv /home/shana/pictures/img_0.jpg
==22726==
==22726== Syscall param writev(vector[...]) points to uninitialised byte(s)
==22726== at 0x5B08990: __writev_nocancel (in /lib64/libc-2.21.so)
==22726== by 0x8A76D9A: _xcb_conn_wait (in /usr/lib64/libxcb.so.1.1.0)
==22726== by 0x8A77190: _xcb_out_send (in /usr/lib64/libxcb.so.1.1.0)
==22726== by 0x8A77214: xcb_writev (in /usr/lib64/libxcb.so.1.1.0)
==22726== by 0x65CE40D: _XSend (in /usr/lib64/libX11.so.6.3.0)
==22726== by 0x65CE901: _XReply (in /usr/lib64/libX11.so.6.3.0)
==22726== by 0x65B9A86: XInternAtom (in /usr/lib64/libX11.so.6.3.0)
==22726== by 0x4EE0CAA: SetWindowBordered (in /usr/lib64/libSDL2-2.0.so.0.2.1)
==22726== by 0x4EE1AE1: X11_CreateWindow (in /usr/lib64/libSDL2-2.0.so.0.2.1)
==22726== by 0x4ED77EB: SDL_CreateWindow_REAL (in /usr/lib64/libSDL2-2.0.so.0.2.1)
==22726== by 0x4047AF: main (in /home/shana/builds/imv/imv)
==22726== Address 0x9919973 is 35 bytes inside a block of size 16,384 alloc'd
==22726== at 0x4C2C060: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22726== by 0x65BEB51: XOpenDisplay (in /usr/lib64/libX11.so.6.3.0)
==22726== by 0x4EDFB04: X11_CreateDevice (in /usr/lib64/libSDL2-2.0.so.0.2.1)
==22726== by 0x4ED7690: SDL_VideoInit_REAL (in /usr/lib64/libSDL2-2.0.so.0.2.1)
==22726== by 0x4E4BDD6: SDL_InitSubSystem_REAL (in /usr/lib64/libSDL2-2.0.so.0.2.1)
==22726== by 0x404741: main (in /home/shana/builds/imv/imv)
==22726==
==22726== Conditional jump or move depends on uninitialised value(s)
==22726== at 0x40568D: create_chequered (in /home/shana/builds/imv/imv)
==22726== by 0x404808: main (in /home/shana/builds/imv/imv)
==22726==
==22726== Conditional jump or move depends on uninitialised value(s)
==22726== at 0x405698: create_chequered (in /home/shana/builds/imv/imv)
==22726== by 0x404808: main (in /home/shana/builds/imv/imv)
==22726==
==22726== Conditional jump or move depends on uninitialised value(s)
==22726== at 0x4056A8: create_chequered (in /home/shana/builds/imv/imv)
==22726== by 0x404808: main (in /home/shana/builds/imv/imv)
==22726==
==22726== Conditional jump or move depends on uninitialised value(s)
==22726== at 0x4027AF: imv_init_texture (in /home/shana/builds/imv/imv)
==22726== by 0x404893: main (in /home/shana/builds/imv/imv)
==22726==
==22726== Conditional jump or move depends on uninitialised value(s)
==22726== at 0x4027C7: imv_init_texture (in /home/shana/builds/imv/imv)
==22726== by 0x404893: main (in /home/shana/builds/imv/imv)
==22726==
==22726== Conditional jump or move depends on uninitialised value(s)
==22726== at 0x402970: imv_texture_set_image (in /home/shana/builds/imv/imv)
==22726== by 0x404E71: main (in /home/shana/builds/imv/imv)
==22726==
==22726== Conditional jump or move depends on uninitialised value(s)
==22726== at 0x4C29F1D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22726== by 0x4029C5: imv_texture_set_image (in /home/shana/builds/imv/imv)
==22726== by 0x404E71: main (in /home/shana/builds/imv/imv)
==22726==
==22726== Conditional jump or move depends on uninitialised value(s)
==22726== at 0x402B0E: imv_texture_set_image (in /home/shana/builds/imv/imv)
==22726== by 0x404E71: main (in /home/shana/builds/imv/imv)
==22726==
==22726== Conditional jump or move depends on uninitialised value(s)
==22726== at 0x402A5A: imv_texture_set_image (in /home/shana/builds/imv/imv)
==22726== by 0x404E71: main (in /home/shana/builds/imv/imv)
==22726==
==22726== Use of uninitialised value of size 8
==22726== at 0x402A88: imv_texture_set_image (in /home/shana/builds/imv/imv)
==22726== by 0x404E71: main (in /home/shana/builds/imv/imv)
==22726==
==22726== Use of uninitialised value of size 8
==22726== at 0x402AAE: imv_texture_set_image (in /home/shana/builds/imv/imv)
==22726== by 0x404E71: main (in /home/shana/builds/imv/imv)
==22726==
==22726== Use of uninitialised value of size 8
==22726== at 0x402AE1: imv_texture_set_image (in /home/shana/builds/imv/imv)
==22726== by 0x404E71: main (in /home/shana/builds/imv/imv)
==22726==
==22726== Conditional jump or move depends on uninitialised value(s)
==22726== at 0x402B2C: imv_texture_set_image (in /home/shana/builds/imv/imv)
==22726== by 0x404E71: main (in /home/shana/builds/imv/imv)
==22726==
==22726== Conditional jump or move depends on uninitialised value(s)
==22726== at 0x402B61: imv_texture_set_image (in /home/shana/builds/imv/imv)
==22726== by 0x404E71: main (in /home/shana/builds/imv/imv)
==22726==
==22726== Conditional jump or move depends on uninitialised value(s)
==22726== at 0x402E23: imv_texture_draw (in /home/shana/builds/imv/imv)
==22726== by 0x4052CD: main (in /home/shana/builds/imv/imv)
==22726==
==22726== Use of uninitialised value of size 8
==22726== at 0x402D44: imv_texture_draw (in /home/shana/builds/imv/imv)
==22726== by 0x4052CD: main (in /home/shana/builds/imv/imv)
==22726==
==22726== Invalid read of size 8
==22726== at 0x402D44: imv_texture_draw (in /home/shana/builds/imv/imv)
==22726== by 0x4052CD: main (in /home/shana/builds/imv/imv)
==22726== Address 0x0 is not stack'd, malloc'd or (recently) free'd
==22726==
==22726==
==22726== Process terminating with default action of signal 11 (SIGSEGV)
==22726== Access not within mapped region at address 0x0
==22726== at 0x402D44: imv_texture_draw (in /home/shana/builds/imv/imv)
==22726== by 0x4052CD: main (in /home/shana/builds/imv/imv)
==22726== If you believe this happened as a result of a stack
==22726== overflow in your program's main thread (unlikely but
==22726== possible), you can try to increase the size of the
==22726== main thread stack using the --main-stacksize= flag.
==22726== The main thread stack size used in this run was 8388608.
==22726==
==22726== HEAP SUMMARY:
==22726== in use at exit: 3,599,060 bytes in 4,233 blocks
==22726== total heap usage: 9,866 allocs, 5,633 frees, 10,872,704 bytes allocated
==22726==
==22726== LEAK SUMMARY:
==22726== definitely lost: 152 bytes in 1 blocks
==22726== indirectly lost: 62,771 bytes in 1,944 blocks
==22726== possibly lost: 3,147,891 bytes in 19 blocks
==22726== still reachable: 388,246 bytes in 2,269 blocks
==22726== suppressed: 0 bytes in 0 blocks
==22726== Rerun with --leak-check=full to see details of leaked memory
==22726==
==22726== For counts of detected and suppressed errors, rerun with: -v
==22726== Use --track-origins=yes to see where uninitialised values come from
==22726== ERROR SUMMARY: 21 errors from 18 contexts (suppressed: 0 from 0)
Segmentation fault