fixed crash caused by improperly formatted jpg images