fix image size to fit view and some pep8.