json_encode isn't actually setting
any indices of your JSON object, you are doing so
json_encode just takes the
structure you provide it, and converts it to a
string in valid JSON (if possible).
What you need to do is instead of using
array_push($row, $width), do
something along the lines of:
= $width;, and the same for
$height. Then your
array will have the key
points to the variable
json_encode will encode it appropriately.