moving add and delete photo functionality to libs