fix #19, only need check first two bytes for jpg