Custom app page link is not working in picture library

hi,

i just created a custom app page for adding values in to the sharepoint list, and i added this page in to site pages in site contents.after that i created a picture library and created image link everything and also added this custom page link to link location, and added this picture library to my page by adding app part,but when we click this picture library link in my page it is giving error like 'something went wrong' but if we click the custom page link directly in picture library or site pages it is coming and also possible to add values to list, but in web site it gives error what could be the problem?

thanks

Ginnas