Fixing image related bugs