fix image availablility check