<?php
add_action( 'after_switch_theme', 'theme_activated' );
add_filter( 'intermediate_image_sizes_advanced', 'remove_default_sizes');

function theme_activated() {
	// Set thumbnail size in settings > media.
	update_option( 'thumbnail_size_w', 150 );
	update_option( 'thumbnail_size_h', 150 );
	update_option( 'thumbnail_crop', 1 );

	// Set medium size in settings > media.
	update_option( 'medium_size_w', 0 );
	update_option( 'medium_size_h', 0 );

	// Set large size in settings > media.
	update_option( 'large_size_w', 0 );
	update_option( 'large_size_h', 0 );
}

function remove_default_sizes( $sizes) {
	unset( $sizes['medium']);
	unset( $sizes['large']);
	unset( $sizes['medium_large']);
	return $sizes;
}