Bug fix: now picture size is picked based on the preview size, but not necessarily equal to it