Replace img-size with my own implementation