fix image displacement bug