Program now correctly loads image files