Add metadata function to image controller, change some routes