diff --git a/libretro-common/formats/png/rpng_nbio.c b/libretro-common/formats/png/rpng_nbio.c
index 5ffc56af89..63ed17a89f 100644
--- a/libretro-common/formats/png/rpng_nbio.c
+++ b/libretro-common/formats/png/rpng_nbio.c
@@ -248,3 +248,14 @@ bool rpng_nbio_load_image_argb_start(struct rpng_t *rpng)
 
    return true;
 }
+
+bool rpng_nbio_is_valid(struct rpng_t *rpng)
+{
+   if (rpng->has_ihdr)
+      return true;
+   if (rpng->has_idat)
+      return true;
+   if (rpng->has_iend)
+      return true;
+   return false;
+}
diff --git a/libretro-common/include/formats/rpng.h b/libretro-common/include/formats/rpng.h
index fdd3ca2032..d4d2342e16 100644
--- a/libretro-common/include/formats/rpng.h
+++ b/libretro-common/include/formats/rpng.h
@@ -105,6 +105,8 @@ bool rpng_load_image_argb(const char *path, uint32_t **data,
 
 struct rpng_t *rpng_nbio_load_image_argb_init(const char *path);
 
+bool rpng_nbio_is_valid(struct rpng_t *rpng);
+
 void rpng_nbio_load_image_free(struct rpng_t *rpng);
 
 bool rpng_nbio_load_image_argb_iterate(uint8_t *buf,
diff --git a/tasks/task_file_transfer.c b/tasks/task_file_transfer.c
index a423677b26..3c83736256 100644
--- a/tasks/task_file_transfer.c
+++ b/tasks/task_file_transfer.c
@@ -185,9 +185,7 @@ static int cb_image_menu_generic(nbio_handle_t *nbio)
    if (!nbio)
       return -1;
 
-   if (  !nbio->image.handle->has_ihdr || 
-         !nbio->image.handle->has_idat || 
-         !nbio->image.handle->has_iend)
+   if (!rpng_nbio_is_valid(nbio->image.handle))
       return -1;
 
    retval = rpng_nbio_load_image_argb_process(nbio->image.handle,