err function in create image