added "remove directory" functionality to media module