wp_handle_upload Image sizes

I hope I understood your question correctly. Image size are automatically generated according to thumbnail sizes set. For this to work correctly, you first need to add support for thumbnails, and then add any image size that you need inside your theme.

It is also important to know that you first add theme support and then add new image sizes as this will not work if you do this other way around. Also, image sizes are not generated for images already in the media library if new image sizes are added afterwards. WordPress also don’t make upsize(upscaled) versions of an image

I always add these functions inside a my initial theme setup function and then hook this function to the after_setup_theme hook.

Here is what your code should look like

function my_theme_setup() {
   add_theme_support( 'post-thumbnails' );
   add_image_size( 'homepage-thumb', 220, 180, true );
}

add_action( 'after_setup_theme', 'my_theme_setup' );

Remember, there is no need to add the default sizes, they are automatically included. You just need to add image sizes for custom thumbnails.

If you need to generate image sizes from images already in the media library, just download and install Force Regenarate Thumbnails to generate these extra image sizes.

EDIT

Unfortunately you don’t repond to my comments, so I don’t know if your problem is resolved or not. I stumpled upon another possible solution thanks to Adriano Batista in his question “WordPress Displaying Thumbnails Vertically”

I quote directly from his answer

For some reason my php_gd file was disabled in my php.ini file. I uncommented it, ran a regenerate thumbnails plugin in wordpress and viola! It all works now as it should.