fixed bug where invalid image url would crash when getting image dimensions