fix image resizing problem