Added 'loading' notificator to media dialog.

Added ajax-spinner to the media dialog and refactored the page & post
attachments to use the media dialog script.