diff --git a/core/css/styles.css b/core/css/styles.css
index aeb2a5a736309290e2de4323d61f30ebbd582d41..94e60562ad818b2d1ae4fa279fb795d96a7d7e1f 100644
--- a/core/css/styles.css
+++ b/core/css/styles.css
@@ -786,6 +786,10 @@ a.bookmarklet { background-color:#ddd; border:1px solid #ccc; padding:5px;paddin
 	background-color:white;
 	width:100%;
 }
+#oc-dialog-filepicker-content #filestable.filelist {
+	/* prevent the filepicker to overflow */
+	min-width: initial;
+}
 
 #oc-dialog-filepicker-content .filelist td {
 	padding: 14px;
diff --git a/core/js/jquery.ocdialog.js b/core/js/jquery.ocdialog.js
index e26555bd63c5ba168f638c7cdbfd00f039d1a23c..66c7d9bd7f1ec7c36ee40b8637c0ba882b3c0a4d 100644
--- a/core/js/jquery.ocdialog.js
+++ b/core/js/jquery.ocdialog.js
@@ -184,11 +184,11 @@
 			if (content_height> 0) {
 				this.element.css({
 					height: content_height + 'px',
-					width: this.$dialog.innerWidth()-20 + 'px'
+					width: this.$dialog.innerWidth() - 30 + 'px'
 				});
 			} else {
 				this.element.css({
-					width : this.$dialog.innerWidth() - 20 + 'px'
+					width : this.$dialog.innerWidth() - 30 + 'px'
 				});
 			}
 		},