diff --git a/src/filelist.c b/src/filelist.c
index 47b053405f39c8ecda1f8eaf970730df9f3a0c6e..7e9dcbe3105f052edbf6eb92ee6c47c89824c421 100644
--- a/src/filelist.c
+++ b/src/filelist.c
@@ -523,6 +523,7 @@ gib_list *feh_read_filelist(char *filename)
 	FILE *fp;
 	gib_list *list = NULL;
 	char s[1024], s1[1024];
+	Imlib_Load_Error err = IMLIB_LOAD_ERROR_NONE;
 	Imlib_Image tmp_im;
 	struct stat st;
 	signed short tmp_magick_timeout;
@@ -535,12 +536,15 @@ gib_list *feh_read_filelist(char *filename)
 	 */
 	tmp_magick_timeout = opt.magick_timeout;
 	opt.magick_timeout = -1;
-	if (!stat(filename, &st) && S_ISREG(st.st_mode) &&
-			feh_load_image_char(&tmp_im, filename)) {
-		weprintf("Filelist file %s is an image, refusing to use it.\n"
-			"Did you mix up -f and -F?", filename);
-		opt.filelistfile = NULL;
-		return NULL;
+	if (!stat(filename, &st) && S_ISREG(st.st_mode)) {
+		tmp_im = imlib_load_image_with_error_return(filename, &err);
+		if (err == IMLIB_LOAD_ERROR_NONE) {
+			gib_imlib_free_image_and_decache(tmp_im);
+			weprintf("Filelist file %s is an image, refusing to use it.\n"
+				"Did you mix up -f and -F?", filename);
+			opt.filelistfile = NULL;
+			return NULL;
+		}
 	}
 	opt.magick_timeout = tmp_magick_timeout;