fix image loading bugs/ improvements