Added the possibility to set the width and height of the texture and fixed some bugs.