add the favorites option

added the functionality for the favorites option and the favorites
page, the popup in the favorites page has the favorites button also
because I just reused the code from the gallery page