Fixed scope bug in uploadmanager.
Upload works with CKFinder. Replace image after upload.
Fixed bug in condition.
Upload manager refactoring.
Change imgHeaderRegExp to more generic base64HeaderRegExp.
Check file extension before upload.