fix small bugs
change checking filetype to use subprocess instead of magic library
fix image to sprite implementation