modified require library to support images