Scala rewrite of ImgScalr