Before you access the property of any array/object check whether it has value or not using isset or empty functions.
isset
empty
For an example
if(!empty($image_meta['width'])){ }
It will solve your problem!