Have a look to wp_get_attachment_image_src(), which gives precisely data you need (URL and dimensions). Which help to figure out your problem.
sample code
$image_attributes = wp_get_attachment_image_src( $attachment_id = 10 );
if ( $image_attributes ) : ?>
<img src="https://wordpress.stackexchange.com/questions/302831/<?php echo $image_attributes[0]; ?>" width="<?php echo $image_attributes[1]; ?>" height="<?php echo $image_attributes[2]; ?>" />
<?php endif; ?>
The return section gives keys, but the function just returns indexes as.
array{
[0] => url,
[1] => width,
[2] => height,
[3] => is_intermediate (boolean)
}
We should make it clearer what is returned by this function. And some description or a link to explain is_intermediate.