Grafana Pyroscope unveiled that we are hitting ad10fbd3c4/src/database/sql/sql.go (L2739-L2742) for media DB queries. Making the methods pointer receivers fixes this. (Also some minor `error` cosmetic updates)
ad10fbd3c4/src/database/sql/sql.go (L2739-L2742)
Sister PR to https://github.com/matrix-org/gomatrixserverlib/pull/364 Read this commit by commit to avoid going insane.
* Refactor mediaapi storage layer * Verify filetype before trying to create thumbnails * Add media api storage tests * Fix returned values