fix image fetch logic