diff --git a/api/graphql/models/share_token.go b/api/graphql/models/share_token.go
index 4ba0c20..53974f9 100644
--- a/api/graphql/models/share_token.go
+++ b/api/graphql/models/share_token.go
@@ -3,6 +3,8 @@ package models
 import (
 	"database/sql"
 	"time"
+
+	"github.com/pkg/errors"
 )
 
 type ShareToken struct {
@@ -27,7 +29,7 @@ func NewShareTokenFromRow(row *sql.Row) (*ShareToken, error) {
 	token := ShareToken{}
 
 	if err := row.Scan(&token.TokenID, &token.Value, &token.OwnerID, &token.Expire, &token.Password, &token.AlbumID, &token.MediaID); err != nil {
-		return nil, err
+		return nil, errors.Wrap(err, "failed to scan share token from database")
 	}
 
 	return &token, nil
@@ -39,7 +41,7 @@ func NewShareTokensFromRows(rows *sql.Rows) ([]*ShareToken, error) {
 	for rows.Next() {
 		var token ShareToken
 		if err := rows.Scan(&token.TokenID, &token.Value, &token.OwnerID, &token.Expire, &token.Password, &token.AlbumID, &token.MediaID); err != nil {
-			return nil, err
+			return nil, errors.Wrap(err, "failed to scan share tokens from database")
 		}
 		tokens = append(tokens, &token)
 	}
diff --git a/api/graphql/models/user.go b/api/graphql/models/user.go
index b333f3e..9bd9a00 100644
--- a/api/graphql/models/user.go
+++ b/api/graphql/models/user.go
@@ -3,12 +3,12 @@ package models
 import (
 	"crypto/rand"
 	"database/sql"
-	"errors"
 	"fmt"
 	"log"
 	"os"
 	"time"
 
+	"github.com/pkg/errors"
 	"golang.org/x/crypto/bcrypt"
 )
 
@@ -35,7 +35,7 @@ func NewUserFromRow(row *sql.Row) (*User, error) {
 	user := User{}
 
 	if err := row.Scan(&user.UserID, &user.Username, &user.Password, &user.RootPath, &user.Admin); err != nil {
-		return nil, err
+		return nil, errors.Wrap(err, "failed to scan user from database")
 	}
 
 	return &user, nil
@@ -47,7 +47,7 @@ func NewUsersFromRows(rows *sql.Rows) ([]*User, error) {
 	for rows.Next() {
 		var user User
 		if err := rows.Scan(&user.UserID, &user.Username, &user.Password, &user.RootPath, &user.Admin); err != nil {
-			return nil, err
+			return nil, errors.Wrap(err, "failed to scan users from database")
 		}
 		users = append(users, &user)
 	}
@@ -77,7 +77,7 @@ func AuthorizeUser(database *sql.DB, username string, password string) (*User, e
 		if err == bcrypt.ErrMismatchedHashAndPassword {
 			return nil, ErrorInvalidUserCredentials
 		} else {
-			return nil, err
+			return nil, errors.Wrap(err, "compare user password hash")
 		}
 	}
 
@@ -104,16 +104,16 @@ func RegisterUser(database *sql.Tx, username string, password *string, rootPath
 	if password != nil {
 		hashedPassBytes, err := bcrypt.GenerateFromPassword([]byte(*password), 12)
 		if err != nil {
-			return nil, err
+			return nil, errors.Wrap(err, "failed to hash password")
 		}
 		hashedPass := string(hashedPassBytes)
 
 		if _, err := database.Exec("INSERT INTO user (username, password, root_path, admin) VALUES (?, ?, ?, ?)", username, hashedPass, rootPath, admin); err != nil {
-			return nil, err
+			return nil, errors.Wrap(err, "insert new user with password into database")
 		}
 	} else {
 		if _, err := database.Exec("INSERT INTO user (username, root_path, admin) VALUES (?, ?, ?)", username, rootPath, admin); err != nil {
-			return nil, err
+			return nil, errors.Wrap(err, "insert user without password into database")
 		}
 	}
 
diff --git a/api/graphql/resolvers/share_token.go b/api/graphql/resolvers/share_token.go
index e6d6573..bf08f70 100644
--- a/api/graphql/resolvers/share_token.go
+++ b/api/graphql/resolvers/share_token.go
@@ -34,7 +34,7 @@ func (r *shareTokenResolver) Album(ctx context.Context, obj *models.ShareToken)
 		if err == sql.ErrNoRows {
 			return nil, nil
 		} else {
-			return nil, err
+			return nil, errors.Wrap(err, "could not get album of share token from database")
 		}
 	}
 
@@ -48,7 +48,7 @@ func (r *shareTokenResolver) Media(ctx context.Context, obj *models.ShareToken)
 		if err == sql.ErrNoRows {
 			return nil, nil
 		} else {
-			return nil, err
+			return nil, errors.Wrap(err, "could not get media of share token from database")
 		}
 	}
 
@@ -68,7 +68,7 @@ func (r *queryResolver) ShareToken(ctx context.Context, tokenValue string, passw
 		if err == sql.ErrNoRows {
 			return nil, errors.New("share not found")
 		} else {
-			return nil, err
+			return nil, errors.Wrap(err, "failed to get share token from database")
 		}
 	}
 
@@ -77,7 +77,7 @@ func (r *queryResolver) ShareToken(ctx context.Context, tokenValue string, passw
 			if err == bcrypt.ErrMismatchedHashAndPassword {
 				return nil, errors.New("unauthorized")
 			} else {
-				return nil, errors.New("internal server error")
+				return nil, errors.Wrap(err, "failed to compare token password hashes")
 			}
 		}
 	}
@@ -92,7 +92,7 @@ func (r *queryResolver) ShareTokenValidatePassword(ctx context.Context, tokenVal
 		if err == sql.ErrNoRows {
 			return false, errors.New("share not found")
 		} else {
-			return false, err
+			return false, errors.Wrap(err, "failed to get share token from database")
 		}
 	}
 
@@ -108,7 +108,7 @@ func (r *queryResolver) ShareTokenValidatePassword(ctx context.Context, tokenVal
 		if err == bcrypt.ErrMismatchedHashAndPassword {
 			return false, nil
 		} else {
-			return false, err
+			return false, errors.Wrap(err, "could not compare token password hashes")
 		}
 	}
 
@@ -123,7 +123,7 @@ func (r *mutationResolver) ShareAlbum(ctx context.Context, albumID int, expire *
 
 	rows, err := r.Database.Query("SELECT owner_id FROM album WHERE album.album_id = ? AND album.owner_id = ?", albumID, user.UserID)
 	if err != nil {
-		return nil, err
+		return nil, errors.Wrap(err, "failed to validate album owner with database")
 	}
 	if rows.Next() == false {
 		return nil, auth.ErrUnauthorized
@@ -134,7 +134,7 @@ func (r *mutationResolver) ShareAlbum(ctx context.Context, albumID int, expire *
 	if password != nil {
 		hashedPassBytes, err := bcrypt.GenerateFromPassword([]byte(*password), 12)
 		if err != nil {
-			return nil, err
+			return nil, errors.Wrap(err, "failed to hash token password")
 		}
 		hashed_str := string(hashedPassBytes)
 		hashed_password = &hashed_str
@@ -143,12 +143,12 @@ func (r *mutationResolver) ShareAlbum(ctx context.Context, albumID int, expire *
 	token := utils.GenerateToken()
 	res, err := r.Database.Exec("INSERT INTO share_token (value, owner_id, expire, password, album_id) VALUES (?, ?, ?, ?, ?)", token, user.UserID, expire, hashed_password, albumID)
 	if err != nil {
-		return nil, err
+		return nil, errors.Wrap(err, "failed to insert new share token into database")
 	}
 
 	token_id, err := res.LastInsertId()
 	if err != nil {
-		return nil, err
+		return nil, errors.Wrap(err, "could not get database id of new album share token")
 	}
 
 	return &models.ShareToken{
@@ -170,7 +170,7 @@ func (r *mutationResolver) ShareMedia(ctx context.Context, mediaID int, expire *
 
 	rows, err := r.Database.Query("SELECT owner_id FROM album, media WHERE media.media_id = ? AND media.album_id = album.album_id AND album.owner_id = ?", mediaID, user.UserID)
 	if err != nil {
-		return nil, err
+		return nil, errors.Wrap(err, "error validating owner of media with database")
 	}
 	if rows.Next() == false {
 		return nil, auth.ErrUnauthorized
@@ -185,12 +185,12 @@ func (r *mutationResolver) ShareMedia(ctx context.Context, mediaID int, expire *
 	token := utils.GenerateToken()
 	res, err := r.Database.Exec("INSERT INTO share_token (value, owner_id, expire, password, media_id) VALUES (?, ?, ?, ?, ?)", token, user.UserID, expire, hashed_password, mediaID)
 	if err != nil {
-		return nil, err
+		return nil, errors.Wrap(err, "failed to insert new share token into database")
 	}
 
 	token_id, err := res.LastInsertId()
 	if err != nil {
-		return nil, err
+		return nil, errors.Wrap(err, "could not get database id of new media share token")
 	}
 
 	return &models.ShareToken{
@@ -252,7 +252,7 @@ func hashSharePassword(password *string) (*string, error) {
 	if password != nil {
 		hashedPassBytes, err := bcrypt.GenerateFromPassword([]byte(*password), 12)
 		if err != nil {
-			return nil, err
+			return nil, errors.Wrap(err, "failed to generate hash for share password")
 		}
 		hashed_str := string(hashedPassBytes)
 		hashed_password = &hashed_str
@@ -271,7 +271,7 @@ func getUserToken(db *sql.DB, user *models.User, tokenValue string) (*models.Sha
 
 	token, err := models.NewShareTokenFromRow(row)
 	if err != nil {
-		return nil, err
+		return nil, errors.Wrap(err, "failed to get user share token from database")
 	}
 
 	return token, nil
diff --git a/ui/src/Pages/AlbumPage/AlbumPage.js b/ui/src/Pages/AlbumPage/AlbumPage.js
index a6fc4b0..f462062 100644
--- a/ui/src/Pages/AlbumPage/AlbumPage.js
+++ b/ui/src/Pages/AlbumPage/AlbumPage.js
@@ -18,7 +18,7 @@ const albumQuery = gql`
           }
         }
       }
-      photos(filter: { order_by: "title", order_direction: DESC }) {
+      media(filter: { order_by: "title", order_direction: DESC }) {
         id
         thumbnail {
           url
diff --git a/ui/src/Pages/SharePage/SharePage.js b/ui/src/Pages/SharePage/SharePage.js
index 2321a8c..a8da311 100644
--- a/ui/src/Pages/SharePage/SharePage.js
+++ b/ui/src/Pages/SharePage/SharePage.js
@@ -30,8 +30,8 @@ const shareTokenQuery = gql`
           }
         }
       }
-      photo {
-        ...PhotoProps
+      media {
+        ...MediaProps
       }
     }
   }
@@ -44,12 +44,12 @@ const shareTokenQuery = gql`
         url
       }
     }
-    photos(filter: { order_by: "title", order_direction: DESC }) {
-      ...PhotoProps
+    media(filter: { order_by: "title", order_direction: DESC }) {
+      ...MediaProps
     }
   }
 
-  fragment PhotoProps on Photo {
+  fragment MediaProps on Media {
     id
     title
     thumbnail {
@@ -104,8 +104,8 @@ const AuthorizedTokenRoute = ({ match }) => {
     return <AlbumSharePage album={data.shareToken.album} match={match} />
   }
 
-  if (data.shareToken.photo) {
-    return <PhotoSharePage photo={data.shareToken.photo} />
+  if (data.shareToken.media) {
+    return <PhotoSharePage photo={data.shareToken.media} />
   }
 
   return <h1>Share not found</h1>
diff --git a/ui/src/components/albumGallery/AlbumGallery.js b/ui/src/components/albumGallery/AlbumGallery.js
index 208f972..e6c4bbc 100644
--- a/ui/src/components/albumGallery/AlbumGallery.js
+++ b/ui/src/components/albumGallery/AlbumGallery.js
@@ -33,12 +33,12 @@ const AlbumGallery = ({ album, loading = false, customAlbumLink }) => {
   }
 
   const nextImage = () => {
-    setActiveImage((imageState.activeImage + 1) % album.photos.length)
+    setActiveImage((imageState.activeImage + 1) % album.media.length)
   }
 
   const previousImage = () => {
     if (imageState.activeImage <= 0) {
-      setActiveImage(album.photos.length - 1)
+      setActiveImage(album.media.length - 1)
     } else {
       setActiveImage(imageState.activeImage - 1)
     }
@@ -92,7 +92,7 @@ const AlbumGallery = ({ album, loading = false, customAlbumLink }) => {
       }
       <PhotoGallery
         loading={loading}
-        photos={album && album.photos}
+        media={album && album.media}
         activeIndex={imageState.activeImage}
         presenting={imageState.presenting}
         onSelectImage={index => {
diff --git a/ui/src/components/photoGallery/Photo.js b/ui/src/components/photoGallery/Photo.js
index a396945..c1ca60c 100644
--- a/ui/src/components/photoGallery/Photo.js
+++ b/ui/src/components/photoGallery/Photo.js
@@ -130,7 +130,7 @@ export const Photo = ({
   if (typeof photo.favorite == 'boolean') {
     heartIcon = (
       <FavoriteIcon
-        favorite={photo.favorite}
+        favorite={photo.favorite.toString()}
         name={photo.favorite ? 'heart' : 'heart outline'}
         onClick={event => {
           event.stopPropagation()
diff --git a/ui/src/components/sidebar/PhotoSidebar.js b/ui/src/components/sidebar/PhotoSidebar.js
index 36ed970..814e1c0 100644
--- a/ui/src/components/sidebar/PhotoSidebar.js
+++ b/ui/src/components/sidebar/PhotoSidebar.js
@@ -10,7 +10,7 @@ import SidebarDownload from './SidebarDownload'
 
 const photoQuery = gql`
   query sidebarPhoto($id: Int!) {
-    photo(id: $id) {
+    media(id: $id) {
       id
       title
       highRes {
@@ -168,7 +168,7 @@ class PhotoSidebar extends Component {
             }
 
             return (
-              <SidebarContent photo={data.photo} hidePreview={hidePreview} />
+              <SidebarContent photo={data.media} hidePreview={hidePreview} />
             )
           }}
         </Query>
diff --git a/ui/src/components/sidebar/Sharing.js b/ui/src/components/sidebar/Sharing.js
index adb878f..a36541e 100644
--- a/ui/src/components/sidebar/Sharing.js
+++ b/ui/src/components/sidebar/Sharing.js
@@ -14,7 +14,7 @@ import copy from 'copy-to-clipboard'
 
 const sharePhotoQuery = gql`
   query sidbarGetPhotoShares($id: Int!) {
-    photo(id: $id) {
+    media(id: $id) {
       id
       shares {
         token
@@ -38,7 +38,7 @@ const shareAlbumQuery = gql`
 
 const addPhotoShareMutation = gql`
   mutation sidebarPhotoAddShare($id: Int!, $password: String, $expire: Time) {
-    sharePhoto(photoId: $id, password: $password, expire: $expire) {
+    shareMedia(mediaId: $id, password: $password, expire: $expire) {
       token
     }
   }
@@ -254,7 +254,7 @@ const SidebarShare = ({ photo, album }) => {
   }
 
   if (!content) {
-    const shares = isPhoto ? sharesData.photo.shares : sharesData.album.shares
+    const shares = isPhoto ? sharesData.media.shares : sharesData.album.shares
 
     const optionsRows = shares.map(share => (
       <Table.Row key={share.token}>
diff --git a/ui/src/components/sidebar/SidebarDownload.js b/ui/src/components/sidebar/SidebarDownload.js
index 6a229a2..406e820 100644
--- a/ui/src/components/sidebar/SidebarDownload.js
+++ b/ui/src/components/sidebar/SidebarDownload.js
@@ -8,8 +8,8 @@ import gql from 'graphql-tag'
 import download from 'downloadjs'
 
 const downloadQuery = gql`
-  query sidebarDownloadQuery($photoId: Int!) {
-    photo(id: $photoId) {
+  query sidebarDownloadQuery($mediaId: Int!) {
+    media(id: $mediaId) {
       id
       downloads {
         title
@@ -149,13 +149,13 @@ const SidebarDownload = ({ photo }) => {
   const [
     loadPhotoDownloads,
     { called, loading, data },
-  ] = useLazyQuery(downloadQuery, { variables: { photoId: photo.id } })
+  ] = useLazyQuery(downloadQuery, { variables: { mediaId: photo.id } })
 
   let downloads = []
 
   if (called) {
     if (!loading) {
-      downloads = data && data.photo.downloads
+      downloads = data && data.media.downloads
     }
   } else {
     if (!photo.downloads) {
