scala implementation of imgur... ish