Updated prepare_asset for efficient 'directory' asset handling