use prepared statement to get file by id to speed up these commonly used queries