adding width and height parameters to setImg method