refactored views and separated instagram operation on photos.py