Removed unused mutex
Fixed deadlock in image loading code
Return error together with images

All functions can return nil objects if the images are missing. Better
to return errors in those cases.