Removed duplicate code and added ui for compression option
Added functions for compressing media files