fix image validation