moved template into main.go and added support for images