Check that the images have content before loading, fixes a segfault