correct logic if getimagesize() fails