Index: media.php
===================================================================
--- media.php	(revision 23637)
+++ media.php	(working copy)
@@ -191,6 +191,21 @@
 }
 
 /**
+ * Wrapper for adding required files in media_sideload_image from non wp-admin locations
+ *
+ * @since
+ *
+ */
+function external_media_load() {
+
+    require_once(ABSPATH . 'wp-admin' . '/includes/image.php');
+    require_once(ABSPATH . 'wp-admin' . '/includes/file.php');
+    require_once(ABSPATH . 'wp-admin' . '/includes/media.php');
+
+}
+
+
+/**
  * This handles the file upload POST itself, creating the attachment post.
  *
  * @since 2.5.0
