added quota check on restore media
rewritten pagination in media_select_dlg