Fixed the imgupl-function