change photo size and fix some bugs