Show thumbnail depending on image width

I think the problem is that you’re trying to get the metadata for an image without specifying which size you want the width and height from.

    $imgData     = wp_get_attachment_metadata( get_post_thumbnail_id( get_the_ID() ) );
    $width       = $imgData['width'];
    $height      = $imgData['height'];

Instead try this:

    $imgID       = get_post_thumbnail_id( get_the_ID() );
    $imgURL      = wp_get_attachment_image_src( $imgID, 'full' ); // now I know which image specifically I want - in this case 'full'.
    $width       = $imgURL['1']; // I've never tested 'height' and 'width', but 100% the array numbers work
    $height      = $imgURL['2'];

Now I know the height and width of the specific img url I’m testing.