updated to use request.site.port variable rather than hard coding the port for local images