Optimized script for enqueuing all media