fixes logic for reloading the current files list
fixes encoding of text in db
factors out the wanted media array